diff options
author | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-10-06 14:32:32 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-11 12:50:56 +0200 |
commit | ad3f78b99e5cd74e9d9643ac8356206f57e796c9 (patch) | |
tree | 68da13f78e4302ca7d040254daeedf0e4ff682fb /drivers/net/wireless/ath/ath6kl/txrx.c | |
parent | 2e1cb23c5e3c38b25a678a8a14d7464341e8207f (diff) | |
download | linux-ad3f78b99e5cd74e9d9643ac8356206f57e796c9.tar.gz |
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.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/txrx.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/txrx.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c index bcf7b01310d0..a9dff01c70a6 100644 --- a/drivers/net/wireless/ath/ath6kl/txrx.c +++ b/drivers/net/wireless/ath/ath6kl/txrx.c @@ -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; |