summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Haber <phaber@broadcom.com>2013-01-10 11:20:48 +0100
committerBen Hutchings <ben@decadent.org.uk>2013-02-06 04:33:43 +0000
commit9741d4ebfe08afb7a925cb60a20dba7c30166bed (patch)
treed367b8c2990ee4a0508a2dfeb8948e6cb345cec7
parenta282707dd03b6cbf4acc77e2d0e9a4ea1ccb2d04 (diff)
downloadlwn-9741d4ebfe08afb7a925cb60a20dba7c30166bed.tar.gz
lwn-9741d4ebfe08afb7a925cb60a20dba7c30166bed.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: Ben Hutchings <ben@decadent.org.uk>
-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 0d8a9cdf897a..78c16ebdfa7f 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1484,9 +1484,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));
}