Skip to contentSkip to conversation

ath6kl: fix null skb dereference in ath6kl_rx()

PATCH Applied Kalle Valo 1 participant 2 messages Oct 6, 2011 – Oct 11, 2011 Atheros ATH6KL wireless driver

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

PATCH 1/1 ath6kl: fix null skb dereference in ath6kl_rx()

smatch found that skb might be null in some cases in ath6kl_rx():

ath6kl/txrx.c +1252 ath6kl_rx(222) error: potential null derefence 'skb'.

This will happen when ath6kl is in AP mode and two clients send traffic to each other.

---
 drivers/net/wireless/ath/ath6kl/txrx.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath6kl/txrx.c +5 -0
index bcf7b01..a9dff01 100644
@@ -1247,6 +1247,11 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
 		}
 		if (skb1)
 			ath6kl_data_tx(skb1, ar->net_dev);
+
+		if (skb == NULL) {
+			/* nothing to deliver up the stack */
+			return;
+		}
 	}
 
 	datap = (struct ethhdr *) skb->data;
author Applied
#1 lore raw
Quoted 6 lines · Kalle Valo

smatch found that skb might be null in some cases in ath6kl_rx():

ath6kl/txrx.c +1252 ath6kl_rx(222) error: potential null derefence 'skb'.

This will happen when ath6kl is in AP mode and two clients send traffic to each other.

Applied to ath6kl.git.

Kalle