From f503b8cff520c5b17d929c7ee8304c2eab7bb20b Mon Sep 17 00:00:00 2001 From: Yangchao Zhou Date: Sun, 11 Sep 2016 17:59:23 +0800 Subject: [PATCH] kni: fix error rollback kernel crash Fixes: 9c61145ff6f9 ("kni: allow multiple threads") Signed-off-by: Yangchao Zhou Acked-by: Ferruh Yigit --- lib/librte_eal/linuxapp/kni/kni_misc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c index 3501dc1bac..071b1585b5 100644 --- a/lib/librte_eal/linuxapp/kni/kni_misc.c +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c @@ -547,7 +547,9 @@ kni_ioctl_create(struct net *net, if (ret) { KNI_ERR("error %i registering device \"%s\"\n", ret, dev_info.name); + kni->net_dev = NULL; kni_dev_remove(kni); + free_netdev(net_dev); return -ENODEV; } -- 2.20.1