rt2x00: do not pause queue unconditionally on error path
authorStanislaw Gruszka <sgruszka@redhat.com>
Tue, 19 Dec 2017 11:33:56 +0000 (12:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:48:11 +0000 (19:48 +0200)
commitc8fed0d73cad36fd01cbd4fc8c18c4307b7bf95c
treec5b3efbefc2135ae10dab41e689605149835e902
parent29a63b0372f0fd6d8edc68829e02fe63ffd2735b
rt2x00: do not pause queue unconditionally on error path

[ Upstream commit 6dd80efd75ce7c2dbd9f117cf585ee2b33a42ee1 ]

Pausing queue without checking threshold is racy with txdone path.
Moreover we do not need pause queue on any error, but only if queue
is full - in case when we send RTS frame ( other cases of almost full
queue are already handled in rt2x00queue_write_tx_frame() ).

Patch fixes of theoretically possible problem of pausing empty
queue.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Tested-by: Enrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c