]> git.baikalelectronics.ru Git - kernel.git/commit
mwifiex: reset card->adapter during device unregister
authorXinming Hu <huxm@marvell.com>
Fri, 18 Nov 2016 14:00:30 +0000 (19:30 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 19 Nov 2016 07:18:50 +0000 (09:18 +0200)
commit6887fbbaa9f0a5cf3ba7d7f01d400afe48b6fd97
tree51fe5fb23dfddafae0eb5eb3912a3a3bc4c61d96
parent41b44179c8899f3a56ae8aa80d17c92753f0502d
mwifiex: reset card->adapter during device unregister

card->adapter gets initialized in mwifiex_register_dev(). As it's not
cleared in mwifiex_unregister_dev(), we may end up accessing the memory
which is already free in below scenario.

Scenario: Driver initialization is failed due to incorrect firmware or
some other reason. Meanwhile device reboot/unload occurs.

This is safe, now that we've properly synchronized suspend() and
remove() with the FW initialization thread; now that code can simply
check for 'card->adapter == NULL' and exit safely.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Tested-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/pcie.c
drivers/net/wireless/marvell/mwifiex/sdio.c