brcmfmac: Fix a double-free in brcmf_sdio_bus_reset
authorTong Tiangen <tongtiangen@huawei.com>
Tue, 1 Jun 2021 10:01:28 +0000 (18:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:21 +0000 (16:56 +0200)
[ Upstream commit 7ea7a1e05c7ff5ffc9f9ec1f0849f6ceb7fcd57c ]

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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210601100128.69561-1-tongtiangen@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

index 59c2b2b6027da00d259fe1aa8d4a26e3457d65bb..6d5d5c39c635960b7ab715b18d3a939a0615a7a2 100644 (file)
@@ -4157,7 +4157,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;