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

net: korina: cast KSEG0 address to pointer in kfree

Fixes gcc warning:

passing argument 1 of 'kfree' makes pointer from integer without a cast

Fixes: 3af5f0f5c74e ("net: korina: fix kfree of rx/tx descriptor array")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Valentin Vidic <vvidic@valentin-vidic.from.hr>
Link: https://lore.kernel.org/r/20201018184255.28989-1-vvidic@valentin-vidic.from.hr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Valentin Vidic and committed by
Jakub Kicinski
3bd57b90 424a646e

+2 -2
+2 -2
drivers/net/ethernet/korina.c
··· 1113 1113 return rc; 1114 1114 1115 1115 probe_err_register: 1116 - kfree(KSEG0ADDR(lp->td_ring)); 1116 + kfree((struct dma_desc *)KSEG0ADDR(lp->td_ring)); 1117 1117 probe_err_td_ring: 1118 1118 iounmap(lp->tx_dma_regs); 1119 1119 probe_err_dma_tx: ··· 1133 1133 iounmap(lp->eth_regs); 1134 1134 iounmap(lp->rx_dma_regs); 1135 1135 iounmap(lp->tx_dma_regs); 1136 - kfree(KSEG0ADDR(lp->td_ring)); 1136 + kfree((struct dma_desc *)KSEG0ADDR(lp->td_ring)); 1137 1137 1138 1138 unregister_netdev(bif->dev); 1139 1139 free_netdev(bif->dev);