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

From: Keita Suzuki
Date: Tue Sep 08 2020 - 15:42:58 EST


Thank you for your comment. I am relatively new to the Linux
kernel community, so I am more than happy to receive comments.
Please let me know if I'm violating any other rules.

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

I will re-send the patch with the change log.

Thanks,
Keita

2020年9月8日(火) 20:18 Arend Van Spriel <arend.vanspriel@xxxxxxxxxxxx>:
>
> 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(-)