From 811a3991510735566b66069fdd4ce3ce33a2ec18 Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Mon, 30 Apr 2018 15:19:17 +0200 Subject: rt2x00: check against flushing empty queue We have check if queue is not empty when start flushing queues on by mac80211 callback, but we also can start flushing queues by internal driver calls. So move check into rt2x00queue_flush_queue() to assure we do not flush empty queue anytime. Additionally add warning if we start to kick empty queue as in such situation we set wrong index in the HW queue, what can confuse the HW and have various negative consequences. Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo --- drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/net/wireless/ralink/rt2x00/rt2x00mac.c') diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c index a971bc7a6b63..c380c1f56ba6 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c @@ -739,8 +739,7 @@ void rt2x00mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, return; tx_queue_for_each(rt2x00dev, queue) - if (!rt2x00queue_empty(queue)) - rt2x00queue_flush_queue(queue, drop); + rt2x00queue_flush_queue(queue, drop); } EXPORT_SYMBOL_GPL(rt2x00mac_flush); -- cgit v1.2.1