summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-11-06 13:01:20 +0300
committerBen Hutchings <ben@decadent.org.uk>2016-02-13 10:34:04 +0000
commit636109645fa424fd896db9f25ddfd39a6cdc110f (patch)
tree167bf3f9324a74d2132e7c92920b063de8b87266
parentc2456538435026a255f4cb0ae25e48fa0970bb06 (diff)
downloadlwn-636109645fa424fd896db9f25ddfd39a6cdc110f.tar.gz
lwn-636109645fa424fd896db9f25ddfd39a6cdc110f.zip
ath9k_htc: check for underflow in ath9k_htc_rx_msg()
commit 3a318426e09a9c9266fe6440842e11238f640a20 upstream. We check for overflow here, but we don't check for underflow so it causes a static checker warning. Fixes: fb9987d0f748 ('ath9k_htc: Support for AR9271 chipset.') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_hst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index 4f7843ae6800..51e256e7578a 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -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