Skip to content

Commit 3af5f0f

Browse files
vvidickuba-moo
authored andcommitted
net: korina: fix kfree of rx/tx descriptor array
kmalloc returns KSEG0 addresses so convert back from KSEG1 in kfree. Also make sure array is freed when the driver is unloaded from the kernel. Fixes: ef11291 ("Add support the Korina (IDT RC32434) Ethernet MAC") Signed-off-by: Valentin Vidic <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8098bd6 commit 3af5f0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/korina.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ static int korina_probe(struct platform_device *pdev)
11131113
return rc;
11141114

11151115
probe_err_register:
1116-
kfree(lp->td_ring);
1116+
kfree(KSEG0ADDR(lp->td_ring));
11171117
probe_err_td_ring:
11181118
iounmap(lp->tx_dma_regs);
11191119
probe_err_dma_tx:
@@ -1133,6 +1133,7 @@ static int korina_remove(struct platform_device *pdev)
11331133
iounmap(lp->eth_regs);
11341134
iounmap(lp->rx_dma_regs);
11351135
iounmap(lp->tx_dma_regs);
1136+
kfree(KSEG0ADDR(lp->td_ring));
11361137

11371138
unregister_netdev(bif->dev);
11381139
free_netdev(bif->dev);

0 commit comments

Comments
 (0)