Skip to content

Commit

Permalink
ath6kl: fix null skb dereference in ath6kl_rx()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kalle Valo committed Nov 11, 2011
1 parent 2e1cb23 commit ad3f78b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/ath/ath6kl/txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ad3f78b

Please sign in to comment.