Re: [PATCH net-next] net: ngbe: fix memory leak in ngbe_probe() error path
From: Jakub Kicinski
Date: Fri Apr 11 2025 - 21:32:22 EST
On Fri, 11 Apr 2025 10:44:55 +0530 Abdun Nihaal wrote:
> Hello Markus,
>
> On Wed, Apr 09, 2025 at 05:23:39PM +0200, Markus Elfring wrote:
> > How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
> > https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.15-rc1#n145
>
> Thanks for pointing that out. Actually I wasn't sure about which commit
> to add as the Fixes tag, so I left it assuming that the maintainers
> would know better.
>
> I was confused between the following two commits both of which change
> the kfree(wx->mac_table) line.
> - 02338c484ab6 ("net: ngbe: Initialize sw info and register netdev")
> - 9607a3e62645 ("net: wangxun: Rename private structure in libwx")
I think:
Fixes: 02338c484ab6 ("net: ngbe: Initialize sw info and register netdev")
rss_key gets allocated at that point but never freed. The later patches
just move it around and fix up a little but first broken patch counts.