summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Haber <phaber@broadcom.com>2013-01-10 11:20:48 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-03 18:24:41 -0600
commitdf2f07099760702c9f3664230263b6be3142b7d7 (patch)
tree8249d3d4e1aa8a10f1696c0df2af58e63ec1f83d
parent8c69e052e2330794fce15b7f299c6c797aed8b7d (diff)
downloadlinux-3.10-df2f07099760702c9f3664230263b6be3142b7d7.tar.gz
linux-3.10-df2f07099760702c9f3664230263b6be3142b7d7.tar.bz2
linux-3.10-df2f07099760702c9f3664230263b6be3142b7d7.zip
brcmsmac: increase timer reference count for new timers only
commit a1fe52801a992e590cdaee2fb47a94bac9b5da90 upstream. On hardware reintialization reference count of already existing timers would be increased again. This leads to problems on module unloading. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Piotr Haber <phaber@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 569ab8abd2a..27f37c7379d 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1400,9 +1400,10 @@ void brcms_add_timer(struct brcms_timer *t, uint ms, int periodic)
#endif
t->ms = ms;
t->periodic = (bool) periodic;
- t->set = true;
-
- atomic_inc(&t->wl->callbacks);
+ if (!t->set) {
+ t->set = true;
+ atomic_inc(&t->wl->callbacks);
+ }
ieee80211_queue_delayed_work(hw, &t->dly_wrk, msecs_to_jiffies(ms));
}