]> git.baikalelectronics.ru Git - kernel.git/commit
brcmsmac: fix memory leak in wlc_phy_attach_lcnphy
authorKeita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Tue, 8 Sep 2020 12:17:41 +0000 (12:17 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 9 Sep 2020 07:32:29 +0000 (10:32 +0300)
commit0b1e5421830037f11ddd6bd47bae6941e7ad079b
treea4bb212e16785adefd363ee8397e5024e8dd7311
parent64757f7e9a0e8809886acc1124fa3fa5160aad18
brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

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.

Signed-off-by: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200908121743.23108-1-keitasuzuki.park@sslab.ics.keio.ac.jp
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c