Commit 639cf97f authored by Dan Carpenter's avatar Dan Carpenter Committed by Luis Henriques

ath9k_htc: check for underflow in ath9k_htc_rx_msg()

commit 3a318426 upstream.

We check for overflow here, but we don't check for underflow so it
causes a static checker warning.

Fixes: fb9987d0 ('ath9k_htc: Support for AR9271 chipset.')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 84b02b20
...@@ -415,7 +415,7 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle, ...@@ -415,7 +415,7 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
return; return;
} }
if (epid >= ENDPOINT_MAX) { if (epid < 0 || epid >= ENDPOINT_MAX) {
if (pipe_id != USB_REG_IN_PIPE) if (pipe_id != USB_REG_IN_PIPE)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment