mwifiex: scan delay timer cleanup in unload path
authorBing Zhao <bzhao@marvell.com>
Thu, 9 May 2013 18:52:50 +0000 (11:52 -0700)
committerChromeBot <chrome-bot@google.com>
Fri, 10 May 2013 22:45:32 +0000 (15:45 -0700)
commit6405943bd698a5ddb1a67ccb13f1b159a96fe097
tree1c4e742aacc8366677d54921b0db65e799b9bdad
parent4360a1e8594c1c4110966571d7aa9aabf88ad1ac
mwifiex: scan delay timer cleanup in unload path

Return from scan delay timer routine if surprise_removed flag
is true. Also, cancel the timer in unload path.

This fixes a crash when scan delay timer accesses structures
that have been freed already.

Tested with "iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio"

BUG=None
TEST="iwlist mlan0 scan & sleep 1; rmmod mwifiex_sdio";
"echo scan > /sys/kernel/debug/kmemleak; cat /sys/kernel/debug/kmemleak"

Change-Id: Ia69b70ecc8b208fce4c2c3f39ec6e2d4042962f6
Reported-by: Daniel Drake <dsd@laptop.org> [OLPC]
Tested-by: Daniel Drake <dsd@laptop.org> [OLPC]
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/50685
Reviewed-by: Paul Stewart <pstew@chromium.org>
drivers/net/wireless/mwifiex/init.c