From: Leon Romanovsky <leon@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Zhang Changzhong <zhangchangzhong@huawei.com>,
Edward Cree <ecree.xilinx@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] sfc: fix potential memleak in __ef100_hard_start_xmit()
Date: Tue, 22 Nov 2022 11:47:09 +0200 [thread overview]
Message-ID: <Y3yanROxeZDR+aNG@unreal> (raw)
In-Reply-To: <0a568e890497f4066128b1ce957904e0c5540c16.camel@redhat.com>
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 <leonro@nvidia.com>
next prev parent reply other threads:[~2022-11-22 9:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 7:50 [PATCH net] sfc: fix potential memleak in __ef100_hard_start_xmit() Zhang Changzhong
2022-11-17 11:36 ` Leon Romanovsky
2022-11-17 12:41 ` Zhang Changzhong
2022-11-17 13:05 ` Leon Romanovsky
2022-11-18 9:15 ` Martin Habets
2022-11-18 11:53 ` Zhang Changzhong
2022-11-18 17:11 ` Leon Romanovsky
2022-11-22 8:28 ` Paolo Abeni
2022-11-22 9:47 ` Leon Romanovsky [this message]
2022-11-18 9:13 ` Martin Habets
2022-11-22 10:40 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y3yanROxeZDR+aNG@unreal \
--to=leon@kernel.org \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=zhangchangzhong@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).