]> git.baikalelectronics.ru Git - kernel.git/commit
ath10k: htt_rx: fix signedness bug in ath10k_update_per_peer_tx_stats
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Fri, 5 Oct 2018 18:42:45 +0000 (20:42 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 13 Oct 2018 17:23:05 +0000 (20:23 +0300)
commiteb4e4390a5d2d42bfe3e903ee33dc924746b4ec1
tree16b2880f8a3fecc980da159da310513add3663aa
parent9f2bb0ab56e10c52f18a70acf12b9bbfc7751aa8
ath10k: htt_rx: fix signedness bug in ath10k_update_per_peer_tx_stats

Currently, the error handling for the call to function
ath10k_get_legacy_rate_idx() doesn't work because
*rate_idx* is of type u8 (8 bits, unsigned), which
makes it impossible for it to hold a value less
than 0.

Fix this by changing the type of variable *rate_idx*
to s8 (8 bits, signed).

Addresses-Coverity-ID: 1473914 ("Unsigned compared against 0")
Fixes: e8bc61c49d32 ("ath10k: get the legacy rate index to update the txrate table")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/htt_rx.c