[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1590809673-105923-1-git-send-email-yangyingliang@huawei.com>
Date: Sat, 30 May 2020 11:34:33 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <xiyou.wangcong@...il.com>, <davem@...emloft.net>,
<netdev@...r.kernel.org>
CC: <yangyingliang@...wei.com>
Subject: [PATCH net] devinet: fix memleak in inetdev_init()
When devinet_sysctl_register() failed, the memory allocated
in neigh_parms_alloc() should be freed.
Fixes: 20e61da7ffcf ("ipv4: fail early when creating netdev named all or default")
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
net/ipv4/devinet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index c0dd561..5267b6b 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -276,6 +276,7 @@ static struct in_device *inetdev_init(struct net_device *dev)
err = devinet_sysctl_register(in_dev);
if (err) {
in_dev->dead = 1;
+ neigh_parms_release(&arp_tbl, in_dev->arp_parms);
in_dev_put(in_dev);
in_dev = NULL;
goto out;
--
1.8.3
Powered by blists - more mailing lists