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

2020-09-08 Thread Arend Van Spriel
On 9/8/2020 2:02 PM, Keita Suzuki wrote: 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. Sure ;-) Here a useful link that Kalle (wireless drivers maintainer) is

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

2020-09-08 Thread Keita Suzuki
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 > > --- > ... changelog here describing difference between previous patch and this >

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

2020-09-08 Thread Arend Van Spriel
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

[PATCH] brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

2020-09-07 Thread Keita Suzuki
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.