Commit 5553271f authored by Amitkumar Karwar's avatar Amitkumar Karwar Committed by Greg Kroah-Hartman

mwifiex: sdio: fix use after free issue for save_adapter


[ Upstream commit 74c8719b ]

If we have sdio work requests received when sdio card reset is
happening, we may end up accessing older save_adapter pointer
later which is already freed during card reset.
This patch solves the problem by cancelling those pending requests.
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b1d4d0e1
......@@ -2296,6 +2296,12 @@ static void mwifiex_recreate_adapter(struct sdio_mmc_card *card)
mmc_hw_reset(func->card->host);
sdio_release_host(func);
/* Previous save_adapter won't be valid after this. We will cancel
* pending work requests.
*/
clear_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP, &iface_work_flags);
clear_bit(MWIFIEX_IFACE_WORK_CARD_RESET, &iface_work_flags);
mwifiex_sdio_probe(func, device_id);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment