From patchwork Sat May 20 07:53:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 96739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp220029vqo; Sat, 20 May 2023 01:06:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5NuCnah0tTkInleOb/8K8MdhXUYBCMQyG+SGbK+zqXB37nG7ibGkBLD3KskMV1lO8s3msM X-Received: by 2002:a17:90a:6309:b0:24d:f1a5:e279 with SMTP id e9-20020a17090a630900b0024df1a5e279mr4662666pjj.12.1684569975885; Sat, 20 May 2023 01:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684569975; cv=none; d=google.com; s=arc-20160816; b=Rey+XAsLY0SwwuX4Gzlc4NDuxZUW6qkGPHfy1KPBDn6GdxjDQWWnObN4GxivpBwWMz wie9jiy6dnvpwLVVScNk3E+vR3Phm2ZSnFNorjt1NIew1oioa1TWmAPVF6g4fNcFPWGM XHJ+XC01TAgGbo3Hei1Ed8S9SN3tJ1ZnBR/xBts3MsEFuKBTBWQTKJBtMbgoeX9yPTpH grCDg8zK5N3TYX7+QkJ/x4NGGQEMFZ1wBFcGazLDhPIYaRREhoMdJLjIFtzEOkql6zmR Sc05nmgmayWjeEIwaJ2PHDqnA+aoG/ghYz5VzTkkKuaFR/uszMOuUyNZ5vF7OsaveuoX ZREQ== 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=MDlJlO33FY7uj3rYCO/3V6AqX7RWZP0/+LeG854Chsc=; b=p+tJ01623lf7pqgh82tsPhezyGcDqS2z+xlmcLNVJENZlRkZovA0fHoiPQUqZvHylD C4cL+o6mUxRu0Nah+81OOev3pONavz4YpcYh7nA/WDoqnsadPTA3bq8KAtxdxpQezM4T onDXCdNmiSlR/1KwwFk/JpAv0kpALu0FfHDY3V64Hi+cLeUGKg9kRAPjUqSmubdH2wWT BLwe0ShKXtZRpGDCl69tCDRf0j6XtY1dqfl2Xzv+AX12M8F9FghMt/PIrtMDm7kgdJ2v IFICwHsZHedR2pVLwb3QpM3F8n8jJJv1W5OWmIYz8qELPsb4RKESjkVe74zi1sck6KV1 Luhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=jbenmieo; 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 a5-20020a17090ad80500b00250aa670558si3126700pjv.43.2023.05.20.01.06.01; Sat, 20 May 2023 01:06:15 -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=jbenmieo; 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 S229890AbjETHxZ (ORCPT + 99 others); Sat, 20 May 2023 03:53:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjETHxX (ORCPT ); Sat, 20 May 2023 03:53:23 -0400 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EFBD1BD for ; Sat, 20 May 2023 00:53:21 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 0HOvqGVAANhDH0HOvqRvZf; Sat, 20 May 2023 09:53:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684569199; bh=MDlJlO33FY7uj3rYCO/3V6AqX7RWZP0/+LeG854Chsc=; h=From:To:Cc:Subject:Date; b=jbenmieo8P8YlN9wS/QLbCsv9uEoQ7tJqUvY7qyi3nF6wSoyhO5PgDLIXXDUDyMjc jsYG1YuaOQgtBKopDT4Bb+5s+KWvYnIxNs0AxFdMRf2RDl004R3CdPhFfIT8KfFhL/ P/kLYo6sJf1aQ+5VwNkW1vfzkl4fkL1xaYAR3iUdAyckZBXGpGrIufzgSK7jEAYQtu qDVqAz4ysyop4F0JdBzQunwfQPHY9ytaikY7ed3UVQXjoNCXbizRkF+PHnMbhGx3Cx oJCbeoZyYzLYd2ycq16z03kHWmi+V57IPBh4FSRIg11CxWWlgOcpv21Gd8XcKu+R/J nEegtuJT0KSeA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 May 2023 09:53:19 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Simon Kelley , 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] atmel: Fix an error handling path in atmel_probe() Date: Sat, 20 May 2023 09:53:14 +0200 Message-Id: <1e65f174607a83348034197fa7d603bab10ba4a9.1684569156.git.christophe.jaillet@wanadoo.fr> 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_H3,RCVD_IN_MSPIKE_WL,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?1766399647389404605?= X-GMAIL-MSGID: =?utf-8?q?1766399647389404605?= Should atmel_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 atmel_probe(), not atmel_attach(). Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions") Signed-off-by: Christophe JAILLET Reviewed-by: Simon Horman --- drivers/net/wireless/atmel/atmel_cs.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/atmel/atmel_cs.c b/drivers/net/wireless/atmel/atmel_cs.c index 453bb84cb338..58bba9875d36 100644 --- a/drivers/net/wireless/atmel/atmel_cs.c +++ b/drivers/net/wireless/atmel/atmel_cs.c @@ -72,6 +72,7 @@ struct local_info { static int atmel_probe(struct pcmcia_device *p_dev) { struct local_info *local; + int ret; dev_dbg(&p_dev->dev, "atmel_attach()\n"); @@ -82,8 +83,16 @@ static int atmel_probe(struct pcmcia_device *p_dev) p_dev->priv = local; - return atmel_config(p_dev); -} /* atmel_attach */ + ret = atmel_config(p_dev); + if (ret) + goto err_free_priv; + + return 0; + +err_free_priv: + kfree(p_dev->priv); + return ret; +} static void atmel_detach(struct pcmcia_device *link) {