Skip to content

Commit 41dc5f8

Browse files
testacegiopsiff
authored andcommitted
wifi: mt76: mt7925: clean up DMA on probe failure
mainline inclusion from mainline-v7.2-rc1 category: bugfix mt7925_pci_probe() initializes DMA before registering the device. If mt7925_register_device() fails, probe returns through err_free_irq without tearing down DMA state. That leaves the TX NAPI instance enabled and skips the DMA queue cleanup that the normal remove path performs through mt7925e_unregister_device(). Add a dedicated unwind label for failures after mt7925_dma_init() succeeds. Fixes: c948b5d ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Co-developed-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Ijae Kim <ae878000@gmail.com> Signed-off-by: Myeonghun Pak <mhun512@gmail.com> Link: https://patch.msgid.link/20260426143728.41534-1-pakmyeonghun@bagmyeonghun-ui-MacBookPro.local Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry picked from commit 9629f31f505d74e76ac0d7a9492fd06c0316fc5d) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent c9ba7ee commit 41dc5f8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • drivers/net/wireless/mediatek/mt76/mt7925

drivers/net/wireless/mediatek/mt76/mt7925/pci.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,12 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
410410

411411
ret = mt7925_register_device(dev);
412412
if (ret)
413-
goto err_free_irq;
413+
goto err_free_dma;
414414

415415
return 0;
416416

417+
err_free_dma:
418+
mt792x_dma_cleanup(dev);
417419
err_free_irq:
418420
devm_free_irq(&pdev->dev, pdev->irq, dev);
419421
err_free_dev:

0 commit comments

Comments
 (0)