diff options
author | Kirill Tkhai <ktkhai@parallels.com> | 2014-02-14 13:17:49 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-02-20 21:49:07 +0100 |
commit | 72471c0d3197d02da53897868692f0b91042f8a5 (patch) | |
tree | 83d3447d12c5b474ac26b302be4cc4273737bd1c /drivers/net/wireless/hostap | |
parent | Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jber... (diff) | |
download | linux-72471c0d3197d02da53897868692f0b91042f8a5.tar.xz linux-72471c0d3197d02da53897868692f0b91042f8a5.zip |
hostap: Do not free priv until timer handler has actually stopped using it
Function del_timer() does not guarantee that timer was really deleted.
If the timer handler is beeing executed at the moment, the function
does nothing. So, it's possible to use already freed memory in the handler:
[ref: Documentation/DocBook/kernel-locking.tmpl]
This was found using grep and compile-tested only. Please, consider
applying or something similar to it.
Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
CC: Jouni Malinen <j@w1.fi>
CC: John W. Linville <linville@tuxdriver.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/hostap')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index d36e252d2ccb..596525528f50 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c @@ -147,7 +147,7 @@ static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) if (!sta->ap && sta->u.sta.challenge) kfree(sta->u.sta.challenge); - del_timer(&sta->timer); + del_timer_sync(&sta->timer); #endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ kfree(sta); |