lkml.org 
[lkml]   [2020]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: ethernet: Fix memleak in ethoc_probe
On Wed, 23 Dec 2020 16:33:04 +0100 Andrew Lunn wrote:
> On Wed, Dec 23, 2020 at 07:06:12PM +0800, Dinghao Liu wrote:
> > When mdiobus_register() fails, priv->mdio allocated
> > by mdiobus_alloc() has not been freed, which leads
> > to memleak.
> >
> > Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
>
> Fixes: bfa49cfc5262 ("net/ethoc: fix null dereference on error exit path")
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Ooof, I applied without looking at your email and I added:

Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core")

I believe this is the correct Fixes tag. Before the exit patch was
freeing both MDIO and the IRQ depending on the fact that kfree(NULL)
is fine. Am I wrong? Not that we can fix it now :)

\
 
 \ /
  Last update: 2020-12-23 21:34    [W:0.065 / U:1.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site