Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4729964rwr; Sun, 23 Apr 2023 11:55:37 -0700 (PDT) X-Google-Smtp-Source: AKy350ZRk7C+pVBc8Wnh0KmiGR9NJBTMKY9hlps0FRZfat7lks/zhsE1lTutvohM41DAXKGVmV+d X-Received: by 2002:a17:902:c94c:b0:1a6:6c79:9d42 with SMTP id i12-20020a170902c94c00b001a66c799d42mr13794775pla.30.1682276137341; Sun, 23 Apr 2023 11:55:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682276137; cv=pass; d=google.com; s=arc-20160816; b=Zql4qBnq7tXzzUlaBeSOrCneqoDxEenb4d3iJdm6bLAHc08y/Q02KqbVtGRBVyEgtJ fW7huC6JUfTudb+xbFdkOpd+RPGx2gwr3fvkcUHZD7MRdcTeikc7yuWjE7wpjuDZPU6H WDkbzmA33cb0GjtujIYIfoXh1C/MkpwaCepIvesy7y+ODmxwcGTFXGGtvQMMYnhZwde0 jTvUloEjFz4seVcp7N/wwMVJKNx09IEGEPn1b6Vq2z4h6yNijwBd6AbZzZf9Q7qcwiJW wXn+BAByR/dv5n7QRtF0Lf7vak4vE3EnXRmQuW6FAh0CqMaDcRGJjKm5R6jZL1CGVZz8 G7hQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3zLwFiA1xNzgURljinB4TnAG6ljf1MccsWxeGyOZvCw=; b=ISSLDLsB7m6JJGrsM0MLL9X5DydZHghxVo1pSRhjo4CjcVr8LfBtYKKgv5/3LTj7fK hBUMpBdPn8N5u3AfKy4ywIk+EnVd9rzk31q03AjH/bLOPhFbxjnrulzeUPJoz6K8qRLR hI9/51S3UMfrZgktezWFWV8rwnV3kTyNXnOdETuQNyGJ98g8GeGGsuaPgQJIirFkWgV8 8ojWif+WitapZvmK3f3UyqD6RYkDfXaqLd4/5UOWUuk2esuzHCDOY4OOfJljkLSJvws4 jvzhEIH60u4oA06qcUwKaermlPhm6kfM8byjY3Ni1QNRoppH5hfCWiRW581+037VxkGI rr8g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=l9R8yB8p; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=NONE sp=NONE dis=NONE) header.from=corigine.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w14-20020a170902e88e00b001a1af4f6089si7552196plg.155.2023.04.23.11.55.25; Sun, 23 Apr 2023 11:55:37 -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=@corigine.onmicrosoft.com header.s=selector2-corigine-onmicrosoft-com header.b=l9R8yB8p; arc=pass (i=1 spf=pass spfdomain=corigine.com dkim=pass dkdomain=corigine.com dmarc=pass fromdomain=corigine.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=NONE sp=NONE dis=NONE) header.from=corigine.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbjDWStO (ORCPT + 99 others); Sun, 23 Apr 2023 14:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjDWStM (ORCPT ); Sun, 23 Apr 2023 14:49:12 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2107.outbound.protection.outlook.com [40.107.223.107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F3FC1A8; Sun, 23 Apr 2023 11:49:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ejLLHOQ+2COBLhTMFO+9CSp63+31c7vXn9g3cG05BrJyjep5qYfDZdzfAniFm9LEfUe5+/BeNOF7NYIM62+kimvLVzfwrIBbrEzo9HqEEecQKkhdsjcHQ3I5zQgUH+9l0c3xIOdAijIKM7byfoaSU+5zpKm5ciYUwfVXXjZNgSyKYosR5w6B4YrxHE3CUTVE0TKJRRSJ/y7YLgXLuvl54eRXPDtB1iclZCAwKHa5YZOi5i4RZjJiASSbjeJwR4x5eASkYvwUL//UkXS9Ht0W0NTel8Qv+bowodmuJkihCv97D8xgJmKIy1VfcjwJZDCXibyGjCLCSPsb7iTbouFkEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3zLwFiA1xNzgURljinB4TnAG6ljf1MccsWxeGyOZvCw=; b=kzzmUprXy5zblx/CTo+NgizhqgysbXyukRzlalGtANO5ItMH25tbXRWqFZNBvrl4D3X1F9oKQP5H3RSaqZuqoztnEQcvoqlnCO1uDiyUtNsuvGyX+Q6xZPg83s1IITyiYywX0acDp2AsUVQ2SlpGDGXjbAypa9mNRNpb1yFkEp5Y9Qx9+UgGfkaTVqJ6e/azOQDa6cTBxNev9iMgBknOR4oDBf/2E5pKZpE70zPpTcPu2HR9M0Sc0T+JzE/fQReqJoDGTqdOdc/gQ0ZmfkMFeJZtdeg114pfLhCxb6AALG1YL/GQgOYVZU24OONc1DspJXffGKUpY25IVsIis8JmHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3zLwFiA1xNzgURljinB4TnAG6ljf1MccsWxeGyOZvCw=; b=l9R8yB8pu76p1D7ysdTMcCakxpMtfmv9aiJyIAYKl3LZadhvyKVp8j8ZHbXWOmqjXY3WBV3pgxdTMatcvwZxd8G76iiY2DPTwvCVXaV8wvQvNATgxNumXXf9DJGSMAq+AQXU+6lLA7QlzIbWYUaUcyuAKrm4s8DLEQkkgsXggfE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by MN2PR13MB3664.namprd13.prod.outlook.com (2603:10b6:208:19f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.32; Sun, 23 Apr 2023 18:49:06 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::f416:544d:18b7:bb34%5]) with mapi id 15.20.6319.033; Sun, 23 Apr 2023 18:49:05 +0000 Date: Sun, 23 Apr 2023 20:48:52 +0200 From: Simon Horman To: Gencen Gan Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , hust-os-kernel-patches@googlegroups.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] net: amd: Fix link leak when verifying config failed Message-ID: References: <20230421183304.155460-1-gangecen@hust.edu.cn> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230421183304.155460-1-gangecen@hust.edu.cn> X-ClientProxiedBy: AS4P251CA0025.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::12) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|MN2PR13MB3664:EE_ X-MS-Office365-Filtering-Correlation-Id: d20b8675-3a56-462c-6799-08db442b69b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bd+bGhxdPjJ+2/59g5qQzAds5ZBBC6xO0uCakDtDUshzJpEULOVFzR6/0GMFgCxlSgvpFOjF7Ffq/iOgYj3M+5TxmKu778oDaCVk7T2XFLTDT91ZYyMycBafY7DzZotwNoCeOnGNf74PRRzZPF6KkXzJ4G46PXbdkCyqEGIt7T+wjPsvrrFalPe2Gu9O1Psklfys5wqKJYEzHVA/pGFaFXyHmg2ePOW1p6TcmRz69AlCdpUKgRjpbY5C8bNT82rGP1WWubtxO1ea1eVGWoTjrksDMs+fELp2MlXW1gyedX6KQ16UOdJncEX/vRFUOvmeOqwQDSYAkhGm6uxR2I9rEPlFFAu1pt+YzKKMRm4ijF/RJzO8xbMXE6x/2I96g6WsZ+rHMehJM2i6rFik2hMdd1G0YV14x3L8v9sdegj04vF0ZOR1hgAmV6s7WxlO8VOUAoy19qe7nDSC8FpPwkdOQfYUXk6/pMhRK+mRRWonkaBpHidT+jNDRCkjTtlTbcwb6mXycKyyn1WHpXc+x3pT2pISbAPs7Z7OPTwdSYUq6ey7y1I9w7dbZznT0V4LrmJ7vNLZWINvAbl+sGX8io/2w8GKRqDgwLW96k3x88bSfEM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(346002)(366004)(396003)(39830400003)(136003)(451199021)(478600001)(54906003)(86362001)(36756003)(186003)(6486002)(6512007)(6506007)(4326008)(6916009)(66476007)(66556008)(316002)(6666004)(44832011)(83380400001)(66946007)(2906002)(38100700002)(15650500001)(8936002)(41300700001)(8676002)(5660300002)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UQywaAMWJokj+CYKOXzcbaSzkFsqozoRkzIRru/Fo3TT9qfl6Sjp7xMnMyAG?= =?us-ascii?Q?J4PgVOoKdaFQ3haV9cttGNt+VzsBBgkOmyWawlS2aMDd5CCSyfBgcQq9ntgv?= =?us-ascii?Q?dSi45VJgkG2M1EPGREiCoOleDZLxSKv5bSzA/2xFHLBCCqCJV1KfQx8gBNas?= =?us-ascii?Q?gwpF9Mi5aEJbpJFKwHIaPgV6HnO852mK5u1n0hgJM6Dhj6JD8UYlx5lGPLiN?= =?us-ascii?Q?UNx1d08FP4CJ5zmVuXaFylXE+n1ghKtT9Ic/aI46X6HA3QDFPMnAG6ReBaip?= =?us-ascii?Q?G/GoF+HiL9N96QreeiVSElU/fFahy1osM05Vv73dP27XVttV65TrHOfNswDg?= =?us-ascii?Q?GMJW9xmNJW2UvSkPK6g6Bh/54mMBQ6oGF746G3My0mShc/iVeRgetiZKdcvy?= =?us-ascii?Q?gXZVM4hSBNz1HNcF4BeQNQgQpsIOKeXxPz8Gc7qSfCM3I6lO35c5ZyRL2u3c?= =?us-ascii?Q?m+NnlRWUaz2fcjaHlKddiPyYPJWtYvgW6wvohhEM+SOk0HsT+kP7KJRvSrK0?= =?us-ascii?Q?OXUJFfExljEzcOyegCCl4tagYr9z7AO/UClawM27fAA5LXMS4F61iWb1oYdI?= =?us-ascii?Q?lsKEF4geRbAMpzjsPrRvwx8PtXgybwih6WP92+PLNmKLbE8OzV6J4PmXnPBz?= =?us-ascii?Q?jeaDgxiTrgoA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z0saI1RzpH?= =?us-ascii?Q?Zri2yWcJEELpHrTBP5wGt/J6Fk87dsb578NQiwweuB62x7e3BTG0OetJ6u5D?= =?us-ascii?Q?iHXlMPmOtEyGPlHdLcJuqyZfGsbmvUhqJzp3tdn7AU+TXnKkgEE25D//I6fw?= =?us-ascii?Q?5l5pWg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: d20b8675-3a56-462c-6799-08db442b69b3 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2023 18:49:05.2808 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VH/yqpHpIYOCxcqWOi/wOumfdRfKsYjiN8gkRy0MFK3IwJyUMuxS216Sqgi+GsjdGTBeP3+JCgRW7ZVnnBlN13daPOOs/OpmhnMQQRHDbHM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR13MB3664 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 On Sat, Apr 22, 2023 at 02:33:03AM +0800, Gencen Gan wrote: > After failing to verify configuration, it returns directly without > releasing link, which may cause memory leak. > > Paolo Abeni thinks that the whole code of this driver is quite > "suboptimal" and looks unmainatained since at least ~15y, so he > suggests that we could simply remove the whole driver, please > take it into consideration. > > Fixes: 2b3af54dc373 ("net: amd: Fix link leak when verifying config failed") Perhaps it would be better to remove the driver. Perhaps we can take this fix then consider removing it. But if we do move forwards with this patch then I suggest the fixes tag should that below, as: a) The problem seems to have been present since the beginning of git history; and b) The commit above doesn't seem to exist in net or net-next (I assume it's a local commit id of this patch) Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Gan Gecen > Reviewed-by: Paolo Abeni > --- > v2->v3: Add Fixes tag and add a suggestion about this driver. > drivers/net/ethernet/amd/nmclan_cs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/amd/nmclan_cs.c b/drivers/net/ethernet/amd/nmclan_cs.c > index 823a329a921f..0dd391c84c13 100644 > --- a/drivers/net/ethernet/amd/nmclan_cs.c > +++ b/drivers/net/ethernet/amd/nmclan_cs.c > @@ -651,7 +651,7 @@ static int nmclan_config(struct pcmcia_device *link) > } else { > pr_notice("mace id not found: %x %x should be 0x40 0x?9\n", > sig[0], sig[1]); > - return -ENODEV; > + goto failed; > } > } > > -- > 2.34.1 >