Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b30595ae authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo
Browse files

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: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 34440df0
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -428,6 +428,15 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,
		while (msdu_chained--) {
		while (msdu_chained--) {
			struct sk_buff *next = ath10k_htt_rx_netbuf_pop(htt);
			struct sk_buff *next = ath10k_htt_rx_netbuf_pop(htt);


			if (!next) {
				ath10k_warn(ar, "failed to pop chained msdu\n");
				ath10k_htt_rx_free_msdu_chain(*head_msdu);
				*head_msdu = NULL;
				msdu = NULL;
				htt->rx_confused = true;
				break;
			}

			skb_trim(next, 0);
			skb_trim(next, 0);
			skb_put(next, min(msdu_len, HTT_RX_BUF_SIZE));
			skb_put(next, min(msdu_len, HTT_RX_BUF_SIZE));
			msdu_len -= next->len;
			msdu_len -= next->len;