[PATCH] veth: Fix potential memory leak in veth_newlink
From: Haishuang Yan
Date: Wed Apr 27 2016 - 06:43:19 EST
Free peer netdev when failed to configure peer link or register dev.
Signed-off-by: Haishuang Yan <yanhaishuang@xxxxxxxxxxxxxxxxxxxx>
---
drivers/net/veth.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index f37a6e6..8bb9fb8 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -472,7 +472,6 @@ err_register_dev:
/* nothing to do */
err_configure_peer:
unregister_netdevice(peer);
- return err;
err_register_peer:
free_netdev(peer);
--
1.8.3.1