Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4094326rwe; Mon, 17 Apr 2023 07:55:55 -0700 (PDT) X-Google-Smtp-Source: AKy350Zdxd8Dz8eH8Fy6739sxz6sVXXBg3n5JDI0jaI63Olo2iHFE6ehyWrVbbSGmjbZCyswouD5 X-Received: by 2002:a05:6a20:144c:b0:ec:6882:f04b with SMTP id a12-20020a056a20144c00b000ec6882f04bmr18279940pzi.8.1681743355235; Mon, 17 Apr 2023 07:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681743355; cv=none; d=google.com; s=arc-20160816; b=zCfwcaB6LrUETXvh5Y85qE75Dxo3SadC0HR1vnVu3H6XymSKGadrF1TelTuN4w6FgZ BgRnfwj9pfwXQhKjqTb9pjmLkbGLgvrnvzzKoL7Mtx0d212VsgOB7jaN0BpHfSND3ICC lP6eIKxyBZ5uVx32Xl9YTblbNnSL8q+G/1x8uyyp51nHJQ8uemUWkBkBlilOLUM4RmU2 QFuVixVYWgL4u4gYk3uE/oo7DmYEo+8pQg/NGIlYbYOniuAABgXNldl72nrpfWmHcKy1 VGdfNdMCiKht4Oiixei2hecTeG35NB2PeSCCLaMDQs5IV1eTyfoQj0WW0+uxam/9PDpa niFg== 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; bh=7gxSzRmruxhDULbeZ2cyVuFk7KV/Ff/afeupZ97iZ8Q=; b=dNT0PmOQAt0yQp/LFHfUQhzavLidloK8SaKyYl+DWA/kVGorzoNkA4176iXPtYXS3T opyhnDEOA43DJDGjNAEv6zwSQrucTK91UuNzdIW4Gh4rV4yXmZHE9cmGKrLAjcghiIRP 3v6IZ9fahB8KSKbNmuePMz+noOa85qP/ECZzQnw9CwtPqkwBAEU7My3JE/I1hTG25931 25OOywLbN6hy8/wRbBw9lS7mLxvDbdTCQNFqGDug7k1nxyu/FBlvtb5rqm3mEUkdT/Jr OJuPSMqINYyQ6dJa4FCb3W+bWDD34ULae7+frG6FwqR+ktfEurFw8yAAkRqjsE75I1aZ Kj6g== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 144-20020a630796000000b0051871effde5si12013127pgh.326.2023.04.17.07.55.40; Mon, 17 Apr 2023 07:55:55 -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; 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 S230211AbjDQOsc (ORCPT + 99 others); Mon, 17 Apr 2023 10:48:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjDQOsb (ORCPT ); Mon, 17 Apr 2023 10:48:31 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC6C85FE8; Mon, 17 Apr 2023 07:48:30 -0700 (PDT) Received: from liber-MS-7D42.. ([10.12.190.56]) (user=gangecen@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33HElrYQ010631-33HElrYR010631 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Apr 2023 22:48:00 +0800 From: Gencen Gan To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Gecen Gan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: amd: Fix link leak when verifying config failed Date: Mon, 17 Apr 2023 22:47:50 +0800 Message-Id: <20230417144750.3976715-1-gangecen@hust.edu.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: gangecen@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 From: Gecen Gan After failing to verify configuration, it returns directly without releasing link, which may cause memory leak. Signed-off-by: Gecen Gan --- 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