From patchwork Sat May 20 07:38:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 96740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp223907vqo; Sat, 20 May 2023 01:15:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7sjN/WpkUQHIZa3KA8aC8BfzcVj0519UMKO8kQci8IvI1mkgHdI05s4hFWx6PNI82EtCVy X-Received: by 2002:a05:6a20:1008:b0:f3:1c69:7eeb with SMTP id gs8-20020a056a20100800b000f31c697eebmr4198785pzc.17.1684570527657; Sat, 20 May 2023 01:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684570527; cv=none; d=google.com; s=arc-20160816; b=Vam3Vov54pz08iA+oagV4IyoMNkJwqrubKENe41K2vxb0t2UdP1RfUntlBmDe87h2d sI8l9luOvoPmavX+q5mEDizfRsm8yLlTdUTPN8+wmFQ9Pv/ep7D4JzFWbo7robq1QqJB w9Flv94Vt6E7CAqBUvXdKo9vpjQN5fSoE+JAFEoavUvqEkQocNjYtBHBWSoUo27gg+he XtqZyTCLNA4fWvhPRp/vmaNmjGjeHqB0r2bqtT4rn0l0NBnKuYyHIj/zZWxfFuW/VK1G 4zUnzY5vlHCTEg4Q9+qEz4oxWo3mfcjciYVM74CI0xCJl4O0p5zwafWOdfHfYioInBLh /QWQ== 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=NMjTFjxZxa7W+uVqFF89Z29R05LLDCicjWL4MP87TLA=; b=TZYZp8yRme4tNuP9cdWQWF7n+KCifkA1jB3CdqT15Dq0Xj4zGGYcXdp+/E8L2R8Ls2 iheE5yzDGcGAYTcBtjMDon55GSVlPBlbnhHZGcYmRuEa36630oKNCYYnUaV212kknWIo zHWqJSt9YcS6Uz5InSzdOSz9j/df5zNDdWg8MLqHPNYZNkggiMyDj4MNE6KNBs3PMJYP yrTf9eTb0hMNe5RG5tOojZlaFwdvMhdlh9pMirefQVx9AxszQ3PtlAsn9lvGpvqJqjZB kNVcV9OG74xKh1ATpeEQ6HYDg3+tjNHlQzBJzItN36DuwNrLPQFUJvgpCSL8jfex7kNg IRYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=rjfSfBGl; 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 e8-20020a056a0000c800b006359be68abdsi1110624pfj.278.2023.05.20.01.15.12; Sat, 20 May 2023 01:15:27 -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=rjfSfBGl; 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 S230333AbjETHib (ORCPT + 99 others); Sat, 20 May 2023 03:38:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjETHi1 (ORCPT ); Sat, 20 May 2023 03:38:27 -0400 Received: from smtp.smtpout.orange.fr (smtp-27.smtpout.orange.fr [80.12.242.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F224B1A1 for ; Sat, 20 May 2023 00:38:26 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 0HAVqW6X7JVCN0HAVqfvyc; Sat, 20 May 2023 09:38:25 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684568305; bh=NMjTFjxZxa7W+uVqFF89Z29R05LLDCicjWL4MP87TLA=; h=From:To:Cc:Subject:Date; b=rjfSfBGl4jypnBJRKK4oqNz4knkIQvQt35+3zw44PGHb8ZXZAdN6zVsLZP690+JIr /ZR2d8XIqBwP1JuiHyaRMKIGdurVz4gklakLC+Y8qHtfu3BibGOACEVxhewlRNGSdi HsH3opyCszrZ0qEyI+CFyW8MT0aZXr+QX6dqzpsEKuKnMtzFMFGUL0vWzY4dg4uSd9 mim6BrdJVCZETBuzOaWLXt+TnsHPzzK5Vuy2r3KDwmDLYaC0LIZaHoYFkBwIIlYcfl ohxbqvZiRFyzMswmwBir5Zrpq0r2EaAcyqbQZvxNivgc83CgAfJuCky1YU92P6KKl5 4SRn2Bi2Y97QQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 May 2023 09:38:25 +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] orinoco: Fix an error handling path in orinoco_cs_probe() Date: Sat, 20 May 2023 09:38:22 +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=ham 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?1766400225623794964?= X-GMAIL-MSGID: =?utf-8?q?1766400225623794964?= Should orinoco_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 orinoco_cs_probe(), not orinoco_cs_attach(). Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET --- drivers/net/wireless/intersil/orinoco/orinoco_cs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_cs.c b/drivers/net/wireless/intersil/orinoco/orinoco_cs.c index a956f965a1e5..03bfd2482656 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_cs.c @@ -96,6 +96,7 @@ orinoco_cs_probe(struct pcmcia_device *link) { struct orinoco_private *priv; struct orinoco_pccard *card; + int ret; priv = alloc_orinocodev(sizeof(*card), &link->dev, orinoco_cs_hard_reset, NULL); @@ -107,8 +108,16 @@ orinoco_cs_probe(struct pcmcia_device *link) card->p_dev = link; link->priv = priv; - return orinoco_cs_config(link); -} /* orinoco_cs_attach */ + ret = orinoco_cs_config(link); + if (ret) + goto err_free_orinocodev; + + return 0; + +err_free_orinocodev: + free_orinocodev(priv); + return ret; +} static void orinoco_cs_detach(struct pcmcia_device *link) {