Skip to contentSkip to conversation

xfrm interface: don't take extra reference to netdev

PATCH Applied Nicolas Dichtel 2 participants 2 messages Apr 23, 2020 – Apr 28, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfrm interface: don't take extra reference to netdev

I don't see any reason to do this. Maybe needed before commit 56c5ee1a5823 ("xfrm interface: fix memory leak on creation").

---
 net/xfrm/xfrm_interface.c | 2 --
 1 file changed, 2 deletions(-)
net/xfrm/xfrm_interface.c +0 -2
index 3361e3ac5714..eb9928c0a87c 100644
@@ -145,7 +145,6 @@ static int xfrmi_create(struct net_device *dev)
 	if (err < 0)
 		goto out;
 
-	dev_hold(dev);
 	xfrmi_link(xfrmn, xi);
 
 	return 0;
@@ -175,7 +174,6 @@ static void xfrmi_dev_uninit(struct net_device *dev)
 	struct xfrmi_net *xfrmn = net_generic(xi->net, xfrmi_net_id);
 
 	xfrmi_unlink(xfrmn, xi);
-	dev_put(dev);
 }
 
 static void xfrmi_scrub_packet(struct sk_buff *skb, bool xnet)
Signature · 1 line
2.24.0