From mboxrd@z Thu Jan 1 00:00:00 1970 From: zhouyangchao Subject: [PATCH] kni: unregister an unregisterd net_device could cause a kernel crash Date: Sun, 11 Sep 2016 17:59:23 +0800 Message-ID: <20160911095923.7923-1-zhouyates@gmail.com> References: Cc: dev@dpdk.org, zhouyangchao To: ferruh.yigit@intel.com Return-path: Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by dpdk.org (Postfix) with ESMTP id 17CB52C07 for ; Sun, 11 Sep 2016 11:59:25 +0200 (CEST) Received: by mail-pf0-f193.google.com with SMTP id g202so6515328pfb.1 for ; Sun, 11 Sep 2016 02:59:25 -0700 (PDT) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: zhouyangchao --- 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 67e9b7d..5c58a83 100644 --- a/lib/librte_eal/linuxapp/kni/kni_misc.c +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c @@ -545,7 +545,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.10.0