Messages in this thread | | | Date | Wed, 29 Jun 2022 10:43:54 +0100 | From | "Russell King (Oracle)" <> | 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@163.com>
Thanks!
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
| |