Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp6038150rwe; Tue, 18 Apr 2023 15:53:33 -0700 (PDT) X-Google-Smtp-Source: AKy350bJSXca2tXbNdOs4+AY4863OqYCa8Qk1wp70CAVahymyNX5rsKZOl4Xbpu6pXjhGAhvOoZG X-Received: by 2002:a05:6a20:7fa1:b0:d3:78ab:77c3 with SMTP id d33-20020a056a207fa100b000d378ab77c3mr1154629pzj.48.1681858413296; Tue, 18 Apr 2023 15:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681858413; cv=none; d=google.com; s=arc-20160816; b=uzXTmCW802bAqvplIZ3WJ4UcnkJcUsn2xjSRrjmequkFklk5FtcpoBRiKo72fPZU1L VrDFmP7OgNp6zz+EBwetjKYoj5ZsZy8nN1ZPMlr5J1coafqghajurtAWS5wLvww/00uL JUnqBaT5gdklHhBGgSe5G/us9xqF6ia7kl/NnPG2jIUOl8PP9GBbQr+dOV1+Wal29Vpg an0CATxJjE4EXxP3sFO2hM0FLZLGM6do/HELGC5TTEgIdyw7ErknByl3KtcfoJG/6pz+ Gs3sKr1iqSWyzKMEI7oaiiBHGaflRECM+fsZcQpqm1ulfqLs2RtUXptiMXbZulaNKt5a ObVA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=vlZKaJbvfbLt5cwX3T0s3VV1gFXjXYpqUvP/W2u0HLg=; b=TQ/2DHiZ4CFgYPrGR51aMds/2dq1gAPZyDl6zz8yY7R9Ek+QcmJ91Q1ysQN6CdUenL S+LpfKxtvnUV0t3ZcMIdQiA1U1drHvg12vOshsQMnoCBNM+Kkufy8lVLacCsceH8sERA QGYdvg7tQ9njIEyNiYdKbj3Fa6U+kQethfFWYoFITa2juOdKZRKA6C9LfqYjAtoDmuRp hzZFTEhNmKhirrzeT9BjtCfFE3sxhU6rFyUCgmNA7xFD1l7L3rcNb6TXKwxgqx/qTUWa 0gMs7Fk7JL14GkOChG38Nx3CGSb0xkYnKZjkORf7Go/3P4UoN27BaSMMhjcYIwLaPqle +rFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=a9k6pUkl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x5-20020a654145000000b0051b5d2315efsi5238758pgp.845.2023.04.18.15.53.21; Tue, 18 Apr 2023 15:53:33 -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=@kernel.org header.s=k20201202 header.b=a9k6pUkl; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjDRWwV (ORCPT + 99 others); Tue, 18 Apr 2023 18:52:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjDRWwU (ORCPT ); Tue, 18 Apr 2023 18:52:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF1BD1FFE; Tue, 18 Apr 2023 15:52:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8FF4F62C8F; Tue, 18 Apr 2023 22:52:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAF57C433EF; Tue, 18 Apr 2023 22:52:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681858336; bh=de+HR91aylZyjaPhYykVk5+9J82pw/GilutzW+IbEZA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=a9k6pUklOiFdFWtJKWwtr3E5csuPk8CJsxJV2jv14DpS0shBJK4sLGqGwlYtxoatw SRlz/b90fX46Qj96NsUT2Do7/DkaOFOJmpTnxbKqxIXcgQXz0Y3dvhIajF7d4IawPZ tUb3dvRd2eoyThZRlNpl8CO7SdU7GuqopSIC1vjKf0M2+nEcUWkK23pxSODPBdiVuY 7pFL8+CywdVSHXKzFsrICNjUzSujPHrr3PL+dfjFGMzdiHoouiqSZ4/z34EdR5jBdf SRAULUzq9r3/DvbaJlWZqWlOkBwnd7mpoRFLaXbmSUfC+V7Q3I3x9B+cknZg9DE1lQ DHVj7YzZgljNw== Date: Tue, 18 Apr 2023 15:52:15 -0700 From: Jakub Kicinski To: Gencen Gan Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: amd: Fix link leak when verifying config failed Message-ID: <20230418155215.24e7e140@kernel.org> In-Reply-To: <20230417144750.3976715-1-gangecen@hust.edu.cn> References: <20230417144750.3976715-1-gangecen@hust.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 Mon, 17 Apr 2023 22:47:50 +0800 Gencen Gan wrote: > 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; > } > } The patch looks whitespace-damaged, it doesn't apply cleanly. AFAICT there is one space missing in the indentation. Probably your email server is doing something funny to it. -- pw-bot: cr