]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: 3com: 3c59x: fix possible null dereference in vortex_probe1()
authorThomas Fourier <fourier.thomas@gmail.com>
Tue, 6 Jan 2026 09:47:21 +0000 (10:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:12:08 +0000 (13:12 +0100)
commit a4e305ed60f7c41bbf9aabc16dd75267194e0de3 upstream.

pdev can be null and free_ring: can be called in 1297 with a null
pdev.

Fixes: 55c82617c3e8 ("3c59x: convert to generic DMA API")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20260106094731.25819-2-fourier.thomas@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/3com/3c59x.c

index 741c67e546d45034b6b15c4189ad0794e40d0f14..822208dac22c873697631cb63772c90442ed0304 100644 (file)
@@ -1471,7 +1471,7 @@ static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
                return 0;
 
 free_ring:
-       dma_free_coherent(&pdev->dev,
+       dma_free_coherent(gendev,
                sizeof(struct boom_rx_desc) * RX_RING_SIZE +
                sizeof(struct boom_tx_desc) * TX_RING_SIZE,
                vp->rx_ring, vp->rx_ring_dma);