mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
rtw88: fix potential NULL skb access in TX ISR
[ Upstream commitf4f84ff837
] 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:e3037485c6
("rtw88: new Realtek 802.11ac driver") Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
e7e4d0eaa6
commit
034c5f26d2
1 changed files with 5 additions and 0 deletions
|
@ -762,6 +762,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);
|
||||
|
|
Loading…
Reference in a new issue