]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Mon, 26 Oct 2020 14:39:25 +0000 (10:39 -0400)
committerSasha Levin <sashal@kernel.org>
Mon, 26 Oct 2020 14:39:25 +0000 (10:39 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/net-korina-cast-kseg0-address-to-pointer-in-kfree.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/net-korina-cast-kseg0-address-to-pointer-in-kfree.patch b/queue-4.9/net-korina-cast-kseg0-address-to-pointer-in-kfree.patch
new file mode 100644 (file)
index 0000000..2f477c2
--- /dev/null
@@ -0,0 +1,48 @@
+From 9fa779ada90db715a76c088010742a949487f074 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 18 Oct 2020 20:42:55 +0200
+Subject: net: korina: cast KSEG0 address to pointer in kfree
+
+From: Valentin Vidic <vvidic@valentin-vidic.from.hr>
+
+[ 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 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
+index 7e6db87c26aef..cd8895838a04c 100644
+--- a/drivers/net/ethernet/korina.c
++++ b/drivers/net/ethernet/korina.c
+@@ -1188,7 +1188,7 @@ static int korina_probe(struct platform_device *pdev)
+       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);
+-- 
+2.25.1
+
index 177c9e8fb87c1915f9aef081c08c4e45b531724e..4aaf2b4d5722c426c40d34e8f4d414055b2a13f9 100644 (file)
@@ -132,3 +132,4 @@ reiserfs-fix-memory-leak-in-reiserfs_parse_options.patch
 brcm80211-fix-possible-memleak-in-brcmf_proto_msgbuf.patch
 usb-core-solve-race-condition-in-anchor-cleanup-func.patch
 ath10k-check-idx-validity-in-__ath10k_htt_rx_ring_fi.patch
+net-korina-cast-kseg0-address-to-pointer-in-kfree.patch