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 BA530C433FE for ; Tue, 22 Nov 2022 09:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233376AbiKVJrP (ORCPT ); Tue, 22 Nov 2022 04:47:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233083AbiKVJrO (ORCPT ); Tue, 22 Nov 2022 04:47:14 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B258414007; Tue, 22 Nov 2022 01:47:13 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4F049615F8; Tue, 22 Nov 2022 09:47:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E5DEC433C1; Tue, 22 Nov 2022 09:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669110432; bh=UL5MzjRuYkiwDfixp0yElsuBzd8ef1l5k+fEAa+oJwM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EjRz0hp02xXIJwqJ0Kt2F7rWj+ZUVG4GmRJ8wdWkExkqrjSwOl84CUYYRumgzuXMO WVYtwQaLxsSfJNClEbWgoGlkRzWFpvJ6vfWWQ6wBRXvuAyrITOJ4xWnFHLZc45jGgq XKlE0lHiV+0KCCgb+JFR42CYU1DJpDpTy2AIMUTViIAzZ9Vah/yNewiqzLdiVovigZ w2IKdAaKwvKm2TUfxNCyh8cAEur7ZweaDeVYIOqzgOQDP7qhxb7BkGG9g0eDv6jiy+ L3oB8M3t8XxHTb83A0+ZHzfEU5ZflgXOvNk89DT6rYOmf+rLGzlu3ax0VTS7ofstiM 4X1co1K+vXtAQ== Date: Tue, 22 Nov 2022 11:47:09 +0200 From: Leon Romanovsky To: Paolo Abeni Cc: Zhang Changzhong , Edward Cree , "David S. Miller" , Eric Dumazet , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] sfc: fix potential memleak in __ef100_hard_start_xmit() Message-ID: References: <1668671409-10909-1-git-send-email-zhangchangzhong@huawei.com> <0a568e890497f4066128b1ce957904e0c5540c16.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a568e890497f4066128b1ce957904e0c5540c16.camel@redhat.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Nov 22, 2022 at 09:28:42AM +0100, Paolo Abeni wrote: > Hello, > > On Fri, 2022-11-18 at 19:11 +0200, Leon Romanovsky wrote: > > On Fri, Nov 18, 2022 at 09:15:43AM +0000, Martin Habets wrote: > > > On Thu, Nov 17, 2022 at 03:05:27PM +0200, Leon Romanovsky wrote: > > > > Please take a look __ef100_enqueue_skb() and see if it frees SKB on > > > > error or not. If not, please fix it. > > > > > > That function looks ok to me, but I appreciate the extra eyes on it. > > > > __ef100_enqueue_skb() has the following check in error path: > > > > 498 err: > > 499 efx_enqueue_unwind(tx_queue, old_insert_count); > > 500 if (!IS_ERR_OR_NULL(skb)) > > 501 dev_kfree_skb_any(skb); > > 502 > > > > The issue is that skb is never error or null here and this "if" is > > actually always true and can be deleted. > > I think that such additional change could be suite for a different net- > next patch, while this -net patch could land as is, @Leon: do you > agree? > Sure, thanks, Reviewed-by: Leon Romanovsky