Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2021865rwb; Fri, 11 Nov 2022 04:04:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf7vhbrCm9q0YRtV+DPufOoEnxyFDjEmstvnqg4bSDPxnvsqpBBC8JaO1qK6ZJB1Fx61QIgg X-Received: by 2002:aa7:cc91:0:b0:459:4c7:60d7 with SMTP id p17-20020aa7cc91000000b0045904c760d7mr1238901edt.175.1668168253204; Fri, 11 Nov 2022 04:04:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668168253; cv=none; d=google.com; s=arc-20160816; b=NEOlmV+Tuy8NqYUHxE2JcJkaKjB7KZ4Z1l9qwC0oCB4PrMqyijaJUYpAKUd4OrDKnq CfFmWEu5mTZOkMeNNqHfGQ7DhRv1zmIS1JYgm2NHKd8er0zayCa/whPng6kS5n49acce W5Li4aZ5x8dfiPTVmaKzw8UKXoIYXAyumIRmKluOXLc4gL9uJajzFGuRSiCchugEXm0n gD5CT5hyKTmSZN++q58a5m6hiTw/9Y20W+isD2ysJ8nHQcDPL3dwSuVswa+YXeeK/p/M KcKuMArpkzHNLWG3YDkopjo1AY0I7MguzlJnh0+tR4wmXLs49hfno51cOTWkexmoiriE l2sg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bq4-20020a170906d0c400b007abafd4d7d0si1368370ejb.702.2022.11.11.04.03.50; Fri, 11 Nov 2022 04:04:13 -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 + 92 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 Content-Type: text/plain 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 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; } -- 2.9.5