Skip to contentSkip to conversation

ath9k_htc: check for underflow in ath9k_htc_rx_msg()

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 6, 2015 – Nov 26, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k_htc: check for underflow in ath9k_htc_rx_msg()

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.')
drivers/net/wireless/ath/ath9k/htc_hst.c +1 -1
index 2294709..fd85f996 100644
@@ -414,7 +414,7 @@ void ath9k_htc_rx_msg(struct htc_target *htc_handle,
 		return;
 	}
 
-	if (epid >= ENDPOINT_MAX) {
+	if (epid < 0 || epid >= ENDPOINT_MAX) {
 		if (pipe_id != USB_REG_IN_PIPE)
 			dev_kfree_skb_any(skb);
 		else
Applied
#1 lore raw
Quoted 6 lines

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.')

Thanks, applied to wireless-drivers-next.git.

Kalle Valo