]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt7925: clean up DMA on probe failure
authorMyeonghun Pak <mhun512@gmail.com>
Sun, 26 Apr 2026 14:33:36 +0000 (23:33 +0900)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jun 2026 10:15:19 +0000 (10:15 +0000)
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: c948b5da6bbe ("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>
drivers/net/wireless/mediatek/mt76/mt7925/pci.c

index c4161754c01df1ed6e3f79f95dd10f3c1a8c92b5..48837723024d7c11fce10d290f99afdc7cadbc6e 100644 (file)
@@ -415,10 +415,12 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
 
        ret = mt7925_register_device(dev);
        if (ret)
-               goto err_free_irq;
+               goto err_free_dma;
 
        return 0;
 
+err_free_dma:
+       mt792x_dma_cleanup(dev);
 err_free_irq:
        devm_free_irq(&pdev->dev, pdev->irq, dev);
 err_free_dev: