OSDN Git Service

mwifiex: unregister wiphy before freeing resources
authorBrian Norris <briannorris@chromium.org>
Tue, 25 Jul 2017 01:13:21 +0000 (18:13 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 28 Jul 2017 14:47:47 +0000 (17:47 +0300)
commitce32d1d83702064e7746453622fc2d6bdcd8baa4
tree05cecd8052b6d54363b91b69e693f58089c3befc
parent643acea6297f9aa7241cfb17d5b5606186f54137
mwifiex: unregister wiphy before freeing resources

It's possible for some control interfaces (e.g., scans, set freq) to be
active after we've stopped our main work queue and the netif TX queues.
These don't get completely shut out until we've unregistered the wdevs
and wiphy.

So let's only free command buffers and poison our lists after
wiphy_unregister().

This resolves various use-after-free issues seen when resetting the
device.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/init.c
drivers/net/wireless/marvell/mwifiex/main.c
drivers/net/wireless/marvell/mwifiex/main.h