]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Oct 2020 09:38:30 +0000 (10:38 +0100)
commita92781c83f3e08e6444227c9f7a2937516155eb3
tree8c18188929429f0d5e85cacc42403b1d2fd457ae
parent9adcc7d4e518d8b4113c9151dce92303deaa0ae9
brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

[ Upstream commit f4443293d741d1776b86ed1dd8c4e4285d0775fc ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c