From patchwork Sat May 20 07:29:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 96738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp216188vqo; Sat, 20 May 2023 00:59:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44UahNpe1YsGkLrKJMPi+gVhDscqp1PsoJxhW+Hiiethz8OI+WqVLvwyslouzhEEgNWj2C X-Received: by 2002:a05:6a21:99a5:b0:104:beb4:da2c with SMTP id ve37-20020a056a2199a500b00104beb4da2cmr5397442pzb.52.1684569558176; Sat, 20 May 2023 00:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684569558; cv=none; d=google.com; s=arc-20160816; b=ynaItA0d7G+CpbP+bl7HGYWobM6HtRlKUubLyAPxkNFy5gpJt0wNf1ot6+6kR5FPBX ca0vyTYBhCEG825R8/viXkiwcjyjEYI5EUebY8koCAIn/ozIst+c4iENi05ICA9+CyYF PLKnyjcryybDqiDKosnRRTCzyvsNv7ySfBgqPkS6QxOAGnveWAcP++LVzX1Y6gF9Ce7W t9GxkYsOYftK4mZAEqsLAElEA9pY1u/ZueCQw3A2soEHdHOAua/pz7bv9CtP0YdWj3tS FaAKBg0DT4HGdGGkGvLfFIPI3LYjrGagPE4LYY6EpjuHJbTmv3Zab/iyjj88yYe+29g+ 5pYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ID4WM8xku7YVOObLJl5OYwASYrgepFft1NaI5Zy1PNI=; b=0/N/YMq000CF5DENRuoCzP/BB3ZTnTvoE5gvmzT85WuxpC7Xxeuz2VrWQzJMHZKRV9 b46MbHFWEcxRCF5MzR/sKl8kX9lGzmbqPXR2/VG7AOkqsu54n5xP825PYwjiYFlg7PZb tW+VtB+Itf0P71yhWQVHj3bY0JCG3TQwV+DERxsLrMGzlxLOF5njgpObVv2kqGNHoyG0 Sa80HiphSvKQSQBjSr0ya43z19vGSRIP2MRjGBwlhwsej+f9Heg8tJHQ/W0nKlHJOoEX ozT5EQ+tnuqOcOH7+zgpiFPoJhWcrPzRelz9RYZblksn+SGkNIfiEOosIdmr2j5x1Zp6 kDnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=VmU0kId+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x62-20020a638641000000b0053488d41c5asi1175591pgd.330.2023.05.20.00.59.05; Sat, 20 May 2023 00:59:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=VmU0kId+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230114AbjETH3x (ORCPT + 99 others); Sat, 20 May 2023 03:29:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbjETH3w (ORCPT ); Sat, 20 May 2023 03:29:52 -0400 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0F93F7 for ; Sat, 20 May 2023 00:29:50 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 0H2BqV9zozy2w0H2BqUapd; Sat, 20 May 2023 09:29:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684567788; bh=ID4WM8xku7YVOObLJl5OYwASYrgepFft1NaI5Zy1PNI=; h=From:To:Cc:Subject:Date; b=VmU0kId+aJ2dOQ4oUsxNlyGPlcgguYRiJ97KQDbabwsqqkP9HVq8RHBFL2mMS5dSP QdxM487/11CkfUKMVBAo0GX+dtyeJudmly5g7RL/p/jYeFSp1faJZ9NVWNgHljIGPA EXCirkDw9g1S7iP5vGjAQ8R9l6SBSj3kEbcCg+TqQBfyIUSwSzfBo/nhiIGaeuOr00 3693OtpJyjGA+AdIHYEy7VUNP2w2J417ZHa/x9o3B/JE/0mB2u83wJ1toAnugLLTr1 SWjBHXWgAD/S3e+Dx/DkS1izhU9s8I9xOJTqH5UuvP8+gm5xQ/6Sf3kDyfpYYxtz8I rTffN2ZNbXB9Q== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 May 2023 09:29:48 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Kalle Valo , Dominik Brodowski Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-wireless@vger.kernel.org Subject: [PATCH wireless] orinoco: Fix an error handling path in spectrum_cs_probe() Date: Sat, 20 May 2023 09:29:46 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766399209275722846?= X-GMAIL-MSGID: =?utf-8?q?1766399209275722846?= Should spectrum_cs_config() fail, some resources need to be released as already done in the remove function. While at it, remove a useless and erroneous comment. The probe is spectrum_cs_probe(), not spectrum_cs_attach(). Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman --- drivers/net/wireless/intersil/orinoco/spectrum_cs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intersil/orinoco/spectrum_cs.c b/drivers/net/wireless/intersil/orinoco/spectrum_cs.c index 291ef97ed45e..841d623c621a 100644 --- a/drivers/net/wireless/intersil/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/intersil/orinoco/spectrum_cs.c @@ -157,6 +157,7 @@ spectrum_cs_probe(struct pcmcia_device *link) { struct orinoco_private *priv; struct orinoco_pccard *card; + int ret; priv = alloc_orinocodev(sizeof(*card), &link->dev, spectrum_cs_hard_reset, @@ -169,8 +170,16 @@ spectrum_cs_probe(struct pcmcia_device *link) card->p_dev = link; link->priv = priv; - return spectrum_cs_config(link); -} /* spectrum_cs_attach */ + ret = spectrum_cs_config(link); + if (ret) + goto err_free_orinocodev; + + return 0; + +err_free_orinocodev: + free_orinocodev(priv); + return ret; +} static void spectrum_cs_detach(struct pcmcia_device *link) {