kni: fix error rollback kernel crash
authorYangchao Zhou <zhouyates@gmail.com>
Sun, 11 Sep 2016 09:59:23 +0000 (17:59 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 21 Sep 2016 16:36:23 +0000 (18:36 +0200)
Fixes: 9c61145ff6f9 ("kni: allow multiple threads")

Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
lib/librte_eal/linuxapp/kni/kni_misc.c

index 3501dc1..071b158 100644 (file)
@@ -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;
        }