Commit 63610964 authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Hutchings

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 avatarBen Hutchings <ben@decadent.org.uk>
parent c2456538
......@@ -377,7 +377,7 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
htc_hdr = (struct htc_frame_hdr *) skb->data;
epid = htc_hdr->endpoint_id;
if (epid >= ENDPOINT_MAX) {
if (epid < 0 || epid >= ENDPOINT_MAX) {
if (pipe_id != USB_REG_IN_PIPE)
dev_kfree_skb_any(skb);
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