diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2013-06-06 10:30:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 11:57:15 -0700 |
commit | c2ac90b9b4c178936396deb67451e3850c0e5204 (patch) | |
tree | bb8a232b7c1d1dd6415b971d5e30351858adb44d | |
parent | 0ea8a165ab300699ffa3b68721e4837173508eb3 (diff) | |
download | linux-c2ac90b9b4c178936396deb67451e3850c0e5204.tar.gz linux-c2ac90b9b4c178936396deb67451e3850c0e5204.tar.bz2 linux-c2ac90b9b4c178936396deb67451e3850c0e5204.zip |
Staging: rtl8192u: fix a reversed test
Sean MacLennan fixed this in the rtl8192e driver and we should fix
it here as well.
It's pretty harmless. This information comes from the firmware, if
we were to hit this bug we would read beyond the end of the array
once or twice before returning and update our statistics with bogus
data.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8192u/r819xU_cmdpkt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index 002d9b4e47c5..6810766edfcf 100644 --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c @@ -727,7 +727,7 @@ cmpk_message_handle_rx( element type. Because FW may aggregate RX command packet to minimize transmit time between DRV and FW.*/ // Add a counter to prevent the lock in the loop from being held too long - while (total_length > 0 || exe_cnt++ >100) + while (total_length > 0 && exe_cnt++ < 100) { /* 2007/01/17 MH We support aggregation of different cmd in the same packet. */ element_id = pcmd_buff[0]; |