From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
netdev@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>,
"David S . Miller" <davem@davemloft.net>,
linux-arm-kernel@lists.infradead.org,
Navid Emamdoost <navid.emamdoost@gmail.com>
Subject: [PATCH AUTOSEL 5.4 129/187] net: gemini: Fix memory leak in gmac_setup_txqs
Date: Fri, 27 Dec 2019 12:39:57 -0500 [thread overview]
Message-ID: <20191227174055.4923-129-sashal@kernel.org> (raw)
In-Reply-To: <20191227174055.4923-1-sashal@kernel.org>
From: Navid Emamdoost <navid.emamdoost@gmail.com>
[ Upstream commit f37f710353677639bc5d37ee785335994adf2529 ]
In the implementation of gmac_setup_txqs() the allocated desc_ring is
leaked if TX queue base is not aligned. Release it via
dma_free_coherent.
Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/cortina/gemini.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
index a8f4c69252ff..2814b96751b4 100644
--- a/drivers/net/ethernet/cortina/gemini.c
+++ b/drivers/net/ethernet/cortina/gemini.c
@@ -576,6 +576,8 @@ static int gmac_setup_txqs(struct net_device *netdev)
if (port->txq_dma_base & ~DMA_Q_BASE_MASK) {
dev_warn(geth->dev, "TX queue base is not aligned\n");
+ dma_free_coherent(geth->dev, len * sizeof(*desc_ring),
+ desc_ring, port->txq_dma_base);
kfree(skb_tab);
return -ENOMEM;
}
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-12-27 17:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191227174055.4923-1-sashal@kernel.org>
2019-12-27 17:37 ` [PATCH AUTOSEL 5.4 002/187] spi: pxa2xx: Add support for Intel Jasper Lake Sasha Levin
2019-12-27 17:38 ` [PATCH AUTOSEL 5.4 030/187] ARM: dts: imx6ul: imx6ul-14x14-evk.dtsi: Fix SPI NOR probing Sasha Levin
2019-12-27 17:38 ` [PATCH AUTOSEL 5.4 031/187] ARM: vexpress: Set-up shared OPP table instead of individual for each CPU Sasha Levin
2019-12-27 17:38 ` [PATCH AUTOSEL 5.4 039/187] ARM: dts: BCM5301X: Fix MDIO node address/size cells Sasha Levin
2019-12-27 17:38 ` [PATCH AUTOSEL 5.4 047/187] ARM: exynos_defconfig: Restore debugfs support Sasha Levin
2019-12-27 17:38 ` [PATCH AUTOSEL 5.4 048/187] ARM: dts: Cygnus: Fix MDIO node address/size cells Sasha Levin
2019-12-27 17:38 ` [PATCH AUTOSEL 5.4 065/187] ARM: omap2plus_defconfig: Add back DEBUG_FS Sasha Levin
2019-12-27 17:38 ` [PATCH AUTOSEL 5.4 070/187] arm64: dts: ls1028a: fix typo in TMU calibration data Sasha Levin
2019-12-27 17:39 ` [PATCH AUTOSEL 5.4 082/187] arm64: dts: ls1028a: fix reboot node Sasha Levin
2019-12-27 17:39 ` [PATCH AUTOSEL 5.4 083/187] ARM: imx_v6_v7_defconfig: Explicitly restore CONFIG_DEBUG_FS Sasha Levin
2019-12-27 17:39 ` [PATCH AUTOSEL 5.4 085/187] pinctrl: aspeed-g6: Fix LPC/eSPI mux configuration Sasha Levin
2019-12-27 17:39 ` [PATCH AUTOSEL 5.4 096/187] ARM: shmobile: defconfig: Restore debugfs support Sasha Levin
2020-01-09 22:12 ` Geert Uytterhoeven
2019-12-27 17:39 ` [PATCH AUTOSEL 5.4 127/187] clk: at91: fix possible deadlock Sasha Levin
2019-12-27 17:39 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191227174055.4923-129-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=davem@davemloft.net \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=navid.emamdoost@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).