Merge tag 'armsoc-defconfig64' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[linux-2.6-block.git] / net / mac80211 / util.c
index 33344f5a66a85e8a4c0842807249aee3e9d3d02e..3943d4bf289c29b436765d82dd0f241c8b7f5530 100644 (file)
@@ -288,10 +288,13 @@ static void __ieee80211_wake_queue(struct ieee80211_hw *hw, int queue,
        if (!test_bit(reason, &local->queue_stop_reasons[queue]))
                return;
 
-       if (!refcounted)
+       if (!refcounted) {
                local->q_stop_reasons[queue][reason] = 0;
-       else
+       } else {
                local->q_stop_reasons[queue][reason]--;
+               if (WARN_ON(local->q_stop_reasons[queue][reason] < 0))
+                       local->q_stop_reasons[queue][reason] = 0;
+       }
 
        if (local->q_stop_reasons[queue][reason] == 0)
                __clear_bit(reason, &local->queue_stop_reasons[queue]);