From patchwork Fri Nov 11 12:08:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Changzhong X-Patchwork-Id: 18702 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp693016wru; Fri, 11 Nov 2022 03:51:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf6WyXoK2UZ93G08EmQtWFGaJ15St8v92NpKjfs9/+ynALtgJ3T29FcXFLE4WuhrIlRBDWOD X-Received: by 2002:a17:906:9f04:b0:7ae:ed2:5367 with SMTP id fy4-20020a1709069f0400b007ae0ed25367mr1547923ejc.521.1668167497158; Fri, 11 Nov 2022 03:51:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668167497; cv=none; d=google.com; s=arc-20160816; b=gn2matUqkEb2+g/mk+ImpYRYQIy+JQ9E5F9QjSW/D1OQ56SibHqpSX5Hv9ih1p0y6c HGAJU2a9kV7Ks4UJfLFobffIxPlFyniFA8yFobzyVBeK5n425+NRdou8FShuuZmSY/CY zmyfhyhPyV0ubzu6ClnCVuIXL04B/Ucc2JKhdMqXtCioZ29mU87bUBZ46o5Z+zdxofDv 6Ij8dxhzCieS6aDKhN4E785dnH5CIR9aMMXXhRBMrgj4T9CSjSW6aauGhH0UIEcHlLMF 3LVNMWoucLfl/ClCtyZbUcKogfyunFWMPlOA+3mzUSDoLxK7na58VvecQXmIoo8u43eF 6fhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=rWO6FN150Ryt/TZCdYxNiOu0W8jzdrmvbi2GKndld6U=; b=FJHVUZbrZs42JZPFOPLJtBcMJUU2H0qLS4v7xjlhwK5s7vbOy/7iy2L4WM+W6IuumX 1DC7y3qYuPFNORNfYrvvcsnLrBE6xDoJd7Gob3DaUaYxW97j0xr4t5nOk8u6dBGTxKp/ CJjc7EWhp4/WgblP2Hunw6pu3VQRvI3x3AyFtmg8NXgiGXkUglNc/K4d88YAwKpC82L+ jwfebkvTOySxxA86tJRNhO+rkX5I3LfkmosXkLv6OmRTCblBQZkYzPVy2KbqY+M5s0Ib y2DxNUZ6QVIJtouO35LdHHvu7GmmEmvoqZo/U+jO2d+s/LgzloFp2sJia7vQEOzrcJUS sYtA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e18-20020a50ec92000000b004617551556csi1817220edr.128.2022.11.11.03.51.14; Fri, 11 Nov 2022 03:51:37 -0800 (PST) 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; 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233318AbiKKLss (ORCPT + 99 others); Fri, 11 Nov 2022 06:48:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233278AbiKKLsq (ORCPT ); Fri, 11 Nov 2022 06:48:46 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551053896; Fri, 11 Nov 2022 03:48:44 -0800 (PST) Received: from dggpeml500020.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4N7xmW39lRz15M2Q; Fri, 11 Nov 2022 19:48:27 +0800 (CST) Received: from dggpeml500006.china.huawei.com (7.185.36.76) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 11 Nov 2022 19:48:42 +0800 Received: from localhost.localdomain (10.175.112.70) by dggpeml500006.china.huawei.com (7.185.36.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 11 Nov 2022 19:48:41 +0800 From: Zhang Changzhong To: Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Zhang Changzhong , , , Subject: [PATCH 1/3] can: sja1000_isa: add missing free_sja1000dev() in sja1000_isa_probe() Date: Fri, 11 Nov 2022 20:08:41 +0800 Message-ID: <1668168521-5540-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.70] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500006.china.huawei.com (7.185.36.76) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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?1749200401133383588?= X-GMAIL-MSGID: =?utf-8?q?1749200401133383588?= Add the missing free_sja1000dev() before return from sja1000_isa_probe() in the register_sja1000dev() error handling case. In addition, remove blanks before goto labels. Fixes: 2a6ba39ad6a2 ("can: sja1000: legacy SJA1000 ISA bus driver") Signed-off-by: Zhang Changzhong --- drivers/net/can/sja1000/sja1000_isa.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c index d513fac..db3e767 100644 --- a/drivers/net/can/sja1000/sja1000_isa.c +++ b/drivers/net/can/sja1000/sja1000_isa.c @@ -202,22 +202,24 @@ static int sja1000_isa_probe(struct platform_device *pdev) if (err) { dev_err(&pdev->dev, "registering %s failed (err=%d)\n", DRV_NAME, err); - goto exit_unmap; + goto exit_free; } dev_info(&pdev->dev, "%s device registered (reg_base=0x%p, irq=%d)\n", DRV_NAME, priv->reg_base, dev->irq); return 0; - exit_unmap: +exit_free: + free_sja1000dev(dev); +exit_unmap: if (mem[idx]) iounmap(base); - exit_release: +exit_release: if (mem[idx]) release_mem_region(mem[idx], iosize); else release_region(port[idx], iosize); - exit: +exit: return err; }