[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221119071007.3858043-1-cuigaosheng1@huawei.com>
Date: Sat, 19 Nov 2022 15:10:07 +0800
From: Gaosheng Cui <cuigaosheng1@...wei.com>
To: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <thomas.lendacky@....com>,
<shayagr@...zon.com>, <cuigaosheng1@...wei.com>,
<wsa+renesas@...g-engineering.com>, <msink@...monline.ru>
CC: <netdev@...r.kernel.org>
Subject: [PATCH net] net: ethernet: wiznet: w5300: free irq when alloc link_name failed in w5300_hw_probe()
When alloc link_name failed in w5300_hw_probe(), irq has not been
freed. Fix it.
Fixes: 9899b81e7ca5 ("Ethernet driver for the WIZnet W5300 chip")
Signed-off-by: Gaosheng Cui <cuigaosheng1@...wei.com>
---
drivers/net/ethernet/wiznet/w5300.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index b0958fe8111e..5571d4c365e9 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -572,8 +572,10 @@ static int w5300_hw_probe(struct platform_device *pdev)
priv->link_gpio = data ? data->link_gpio : -EINVAL;
if (gpio_is_valid(priv->link_gpio)) {
char *link_name = devm_kzalloc(&pdev->dev, 16, GFP_KERNEL);
- if (!link_name)
+ if (!link_name) {
+ free_irq(irq, ndev);
return -ENOMEM;
+ }
snprintf(link_name, 16, "%s-link", name);
priv->link_irq = gpio_to_irq(priv->link_gpio);
if (request_any_context_irq(priv->link_irq, w5300_detect_link,
--
2.25.1
Powered by blists - more mailing lists