Thread (3 messages) 3 messages, 3 authors, 2022-06-30

Re: [PATCH net v3] net: sfp: fix memory leak in sfp_probe()

From: "Russell King (Oracle)" <linux@armlinux.org.uk>
Date: 2022-06-29 09:44:11
Also in: lkml

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 <redacted>
Thanks!

Reviewed-by: Russell King (Oracle) <redacted>

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help