net: korina: cast KSEG0 address to pointer in kfree
authorValentin Vidic <vvidic@valentin-vidic.from.hr>
Sun, 18 Oct 2020 18:42:55 +0000 (20:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:05:46 +0000 (09:05 +0100)
[ Upstream commit 3bd57b90554b4bb82dce638e0668ef9dc95d3e96 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/korina.c

index 7e6db87c26aef66b6bc07931f8552222c4eb1190..cd8895838a04cda256a78fe286a9c4f3fedab6df 100644 (file)
@@ -1188,7 +1188,7 @@ out:
        return rc;
 
 probe_err_register:
-       kfree(KSEG0ADDR(lp->td_ring));
+       kfree((struct dma_desc *)KSEG0ADDR(lp->td_ring));
 probe_err_td_ring:
        iounmap(lp->tx_dma_regs);
 probe_err_dma_tx:
@@ -1208,7 +1208,7 @@ static int korina_remove(struct platform_device *pdev)
        iounmap(lp->eth_regs);
        iounmap(lp->rx_dma_regs);
        iounmap(lp->tx_dma_regs);
-       kfree(KSEG0ADDR(lp->td_ring));
+       kfree((struct dma_desc *)KSEG0ADDR(lp->td_ring));
 
        unregister_netdev(bif->dev);
        free_netdev(bif->dev);