Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: 3com: 3c59x: fix possible null dereference in vortex_probe1()

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>

authored by

Thomas Fourier and committed by
Jakub Kicinski
a4e305ed c1d73b14

+1 -1
+1 -1
drivers/net/ethernet/3com/3c59x.c
··· 1473 1473 return 0; 1474 1474 1475 1475 free_ring: 1476 - dma_free_coherent(&pdev->dev, 1476 + dma_free_coherent(gendev, 1477 1477 sizeof(struct boom_rx_desc) * RX_RING_SIZE + 1478 1478 sizeof(struct boom_tx_desc) * TX_RING_SIZE, 1479 1479 vp->rx_ring, vp->rx_ring_dma);