diff mbox series

[-next] brcmfmac: Fix a double-free in brcmf_sdio_bus_reset

Message ID 20210601100128.69561-1-tongtiangen@huawei.com
State New
Headers show
Series [-next] brcmfmac: Fix a double-free in brcmf_sdio_bus_reset | expand

Commit Message

Tong Tiangen June 1, 2021, 10:01 a.m. UTC
brcmf_sdiod_remove has been called inside brcmf_sdiod_probe when fails,
so there's no need to call another one. Otherwise, sdiodev->freezer
would be double freed.

Fixes: 7836102a750a ("brcmfmac: reset SDIO bus on a firmware crash")
Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Kalle Valo June 15, 2021, 10:37 a.m. UTC | #1
Tong Tiangen <tongtiangen@huawei.com> wrote:

> brcmf_sdiod_remove has been called inside brcmf_sdiod_probe when fails,

> so there's no need to call another one. Otherwise, sdiodev->freezer

> would be double freed.

> 

> Fixes: 7836102a750a ("brcmfmac: reset SDIO bus on a firmware crash")

> Signed-off-by: Tong Tiangen <tongtiangen@huawei.com>

> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>


Patch applied to wireless-drivers-next.git, thanks.

7ea7a1e05c7f brcmfmac: Fix a double-free in brcmf_sdio_bus_reset

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210601100128.69561-1-tongtiangen@huawei.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
diff mbox series

Patch

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 16ed325795a8..3a1c98a046f0 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -4162,7 +4162,6 @@  static int brcmf_sdio_bus_reset(struct device *dev)
 	if (ret) {
 		brcmf_err("Failed to probe after sdio device reset: ret %d\n",
 			  ret);
-		brcmf_sdiod_remove(sdiodev);
 	}
 
 	return ret;