Re: [PATCH] brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

From: Arend Van Spriel
Date: Tue Sep 08 2020 - 07:28:29 EST


On 9/8/2020 2:13 AM, Keita Suzuki wrote:
When wlc_phy_txpwr_srom_read_lcnphy fails in wlc_phy_attach_lcnphy,
the allocated pi->u.pi_lcnphy is leaked, since struct brcms_phy will be
freed in the caller function.

Fix this by calling wlc_phy_detach_lcnphy in the error handler of
wlc_phy_txpwr_srom_read_lcnphy before returning.

Thanks for resubmitting the patch addressing my comment. For clarity it is recommended to mark the subject with '[PATCH V2]' and add a ...

Signed-off-by: Keita Suzuki <keitasuzuki.park@xxxxxxxxxxxxxxxxxxxx>
---
... changelog here describing difference between previous patch and this version.

Regards,
Arend
---
.../net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)