[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yrwe2oWk/lXkZQgL@shell.armlinux.org.uk>
Date: Wed, 29 Jun 2022 10:43:54 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Jianglei Nie <niejianglei2021@....com>
Cc: andrew@...n.ch, hkallweit1@...il.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v3] net: sfp: fix memory leak in sfp_probe()
On Wed, Jun 29, 2022 at 03:55:50PM +0800, Jianglei Nie wrote:
> sfp_probe() allocates a memory chunk from sfp with sfp_alloc(). When
> devm_add_action() fails, sfp is not freed, which leads to a memory leak.
>
> We should use devm_add_action_or_reset() instead of devm_add_action().
>
> Signed-off-by: Jianglei Nie <niejianglei2021@....com>
Thanks!
Reviewed-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists