[Devel] [PATCH 1/2] venet: free netdevice in destructor

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Tue Jul 25 11:39:46 MSK 2017


This looks like an old typo. Or netdevice logic has changed.
Anyway, netdevice destructor has to call for free_netdev().

Note: there was some strange logic piece, which was exiting destructor
routine, if dev->ml_priv is NULL.
This is an obvious flaw (because the device has to be freed anyways)

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 drivers/net/venetdev.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/venetdev.c b/drivers/net/venetdev.c
index 4954129..5ac62c5 100644
--- a/drivers/net/venetdev.c
+++ b/drivers/net/venetdev.c
@@ -466,6 +466,8 @@ static void venet_destructor(struct net_device *dev)
 
 	if (venet_free_stat)
 		venet_free_stat(dev->nd_net->owner_ve);
+
+	free_netdev(dev);
 }
 
 /*



More information about the Devel mailing list