diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2014-10-23 10:04:24 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-10-24 09:29:19 -0400 |
commit | b30595aea39d6946c1d17c3f278fb8d2fbe2a4cf (patch) | |
tree | a75add4d16f3db69df37282eaecf25517bb09faf /drivers/net | |
parent | 34440df03d638cf31ca915a25537e1addecd7ddc (diff) |
ath10k: add extra sanity check when popping amsdu
The netbuf pop can return NULL. Make sure to check
for that. It shouldn't happen but better safe than
sorry.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htt_rx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 7fa4d872f05c..25bd286391d9 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c | |||
@@ -428,6 +428,15 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, | |||
428 | while (msdu_chained--) { | 428 | while (msdu_chained--) { |
429 | struct sk_buff *next = ath10k_htt_rx_netbuf_pop(htt); | 429 | struct sk_buff *next = ath10k_htt_rx_netbuf_pop(htt); |
430 | 430 | ||
431 | if (!next) { | ||
432 | ath10k_warn(ar, "failed to pop chained msdu\n"); | ||
433 | ath10k_htt_rx_free_msdu_chain(*head_msdu); | ||
434 | *head_msdu = NULL; | ||
435 | msdu = NULL; | ||
436 | htt->rx_confused = true; | ||
437 | break; | ||
438 | } | ||
439 | |||
431 | skb_trim(next, 0); | 440 | skb_trim(next, 0); |
432 | skb_put(next, min(msdu_len, HTT_RX_BUF_SIZE)); | 441 | skb_put(next, min(msdu_len, HTT_RX_BUF_SIZE)); |
433 | msdu_len -= next->len; | 442 | msdu_len -= next->len; |