diff options
author | Yan-Hsuan Chuang <yhchuang@realtek.com> | 2020-01-07 11:08:07 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-01-26 18:42:31 +0300 |
commit | f4f84ff8377d4cedf18317747bc407b2cf657d0f (patch) | |
tree | 904e494898ef8d2ed34450873e13077b542d968f /drivers/net/wireless/realtek/rtw88 | |
parent | 20f2c5fa3af060401c72e444999470a4cab641cf (diff) | |
download | linux-f4f84ff8377d4cedf18317747bc407b2cf657d0f.tar.xz |
rtw88: fix potential NULL skb access in TX ISR
Sometimes the TX queue may be empty and we could possible
dequeue a NULL pointer, crash the kernel. If the skb is NULL
then there is nothing to do, just leave the ISR.
And the TX queue should not be empty here, so print an error
to see if there is anything wrong for DMA ring.
Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88')
-rw-r--r-- | drivers/net/wireless/realtek/rtw88/pci.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index f7770304ba42..1fbc14c149ec 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -835,6 +835,11 @@ static void rtw_pci_tx_isr(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci, while (count--) { skb = skb_dequeue(&ring->queue); + if (!skb) { + rtw_err(rtwdev, "failed to dequeue %d skb TX queue %d, BD=0x%08x, rp %d -> %d\n", + count, hw_queue, bd_idx, ring->r.rp, cur_rp); + break; + } tx_data = rtw_pci_get_tx_data(skb); pci_unmap_single(rtwpci->pdev, tx_data->dma, skb->len, PCI_DMA_TODEVICE); |