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)
committerJakub Kicinski <kuba@kernel.org>
Tue, 20 Oct 2020 00:00:00 +0000 (17:00 -0700)
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>
drivers/net/ethernet/korina.c

index af441d699a57a9f55d16fcaaefffaec6a29803b1..bf48f0ded9c7daab7be0cf4045a1a99a8ac030ce 100644 (file)
@@ -1113,7 +1113,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:
@@ -1133,7 +1133,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);