]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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:03:11 +0000 (09:03 +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 3954c80f70fcb5fba02ed9b7ac6675766d2f454d..b491de946a0e69b18eb53510272fc87c332cfdb1 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);