From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A6A7C352A1 for ; Wed, 7 Dec 2022 09:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UPjyn9qnZM/5LmmiGO371Ye3WRP+usEBh/7EFEoDQFE=; b=cyqpTjcsHiLsZl iS/kUp060n+0DJiamL6gK2gasq5tqdunYBpsZb8GC2Geb528QqAixxOD/CgJ5pAz7BFt4ZVDec2Nf c2ZnOZnLznIf49RIwzTUKKM69jd7tGQqHB9OxoeLxp7iuX6fYidobGUdsMCcnomoO63iJ/5WJ7DQr ubIccMdO046zlOHH4dJDbrZNndvgoheV0NkLMFS0B82+Ojs5PfKxYSLzKxdJgIsG1BQEIvox8kvOZ N/io7mhKf5o3ogGH3ykxtl4woiMpX85/ty4X+0Ezd4rMqEhr4bwKppsPGPHB5s2IjAiAODrt2C+pk 31xgoxkJdvUJ7DUnZuNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2qUg-00FuGC-6t; Wed, 07 Dec 2022 09:13:34 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2qUd-00FuEo-3w for linux-arm-kernel@lists.infradead.org; Wed, 07 Dec 2022 09:13:32 +0000 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 0E6AE60BC3; Wed, 7 Dec 2022 09:13:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAABBC433C1; Wed, 7 Dec 2022 09:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670404409; bh=eS/FqO4dJ70H+Gw9HdEBtknKGdxHesbCy+r25riz/G8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cBzmAWspWNRBSswWavNnGco+Lf8bRF41RxCGsNnmIOpiwbP9F4fAgLdWZ7AomrpTQ ybfBXA4Vz7eYAYMfvyCY8BtfZgJ7P2ZkBJPyg8CLGJ36o6ML7EBdIrCyZvTB77/kyM liGQKUiFlYJyIqkK4ExOR9g2JTXm99I8VvbO0C/Ihs2yJLeFw21Ns11VCjspHye5/2 gy9+MNjZZh0/8FkbV2PmHZaCT+xyBxeIrHJ/Pho/5OwfNVFAozx2nxoSg1E+W7o1Fw Ej2Hp2e9i8jWppE3izNfds9wHqI2O6hPuj4mefgZcQw+0XiZRzQ/YJlpeVnKDCGcz4 /HXUEBUAg9URQ== Date: Wed, 7 Dec 2022 11:13:24 +0200 From: Leon Romanovsky To: Gaosheng Cui Cc: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, boon.leong.ong@intel.com, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net] net: stmmac: fix possible memory leak in stmmac_dvr_probe() Message-ID: References: <20221207083413.1758113-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221207083413.1758113-1-cuigaosheng1@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221207_011331_230597_DE820422 X-CRM114-Status: GOOD ( 12.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 07, 2022 at 04:34:13PM +0800, Gaosheng Cui wrote: > The bitmap_free() should be called to free priv->af_xdp_zc_qps > when create_singlethread_workqueue() fails, otherwise there will > be a memory leak, so we add the err path error_wq_init to fix it. > > Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy") > Signed-off-by: Gaosheng Cui > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51E38C352A1 for ; Wed, 7 Dec 2022 09:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230087AbiLGJO5 (ORCPT ); Wed, 7 Dec 2022 04:14:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbiLGJOP (ORCPT ); Wed, 7 Dec 2022 04:14:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BBF2A279 for ; Wed, 7 Dec 2022 01:13:32 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id CBFF8B80189 for ; Wed, 7 Dec 2022 09:13:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAABBC433C1; Wed, 7 Dec 2022 09:13:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670404409; bh=eS/FqO4dJ70H+Gw9HdEBtknKGdxHesbCy+r25riz/G8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cBzmAWspWNRBSswWavNnGco+Lf8bRF41RxCGsNnmIOpiwbP9F4fAgLdWZ7AomrpTQ ybfBXA4Vz7eYAYMfvyCY8BtfZgJ7P2ZkBJPyg8CLGJ36o6ML7EBdIrCyZvTB77/kyM liGQKUiFlYJyIqkK4ExOR9g2JTXm99I8VvbO0C/Ihs2yJLeFw21Ns11VCjspHye5/2 gy9+MNjZZh0/8FkbV2PmHZaCT+xyBxeIrHJ/Pho/5OwfNVFAozx2nxoSg1E+W7o1Fw Ej2Hp2e9i8jWppE3izNfds9wHqI2O6hPuj4mefgZcQw+0XiZRzQ/YJlpeVnKDCGcz4 /HXUEBUAg9URQ== Date: Wed, 7 Dec 2022 11:13:24 +0200 From: Leon Romanovsky To: Gaosheng Cui Cc: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, boon.leong.ong@intel.com, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net] net: stmmac: fix possible memory leak in stmmac_dvr_probe() Message-ID: References: <20221207083413.1758113-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207083413.1758113-1-cuigaosheng1@huawei.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, Dec 07, 2022 at 04:34:13PM +0800, Gaosheng Cui wrote: > The bitmap_free() should be called to free priv->af_xdp_zc_qps > when create_singlethread_workqueue() fails, otherwise there will > be a memory leak, so we add the err path error_wq_init to fix it. > > Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy") > Signed-off-by: Gaosheng Cui > --- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky