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

Submitted by Stanislav Kinsburskiy on July 25, 2017, 8:39 a.m.


Message ID 20170725083946.1832.88880.stgit@localhost.localdomain
State New
Series "venet: fix device leakage in destructor"
Headers show

Commit Message

Stanislav Kinsburskiy July 25, 2017, 8:39 a.m.
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@virtuozzo.com>
 drivers/net/venetdev.c |    2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

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)
+	free_netdev(dev);