From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 003C5558A for ; Thu, 25 Aug 2016 15:49:05 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP; 25 Aug 2016 06:49:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,575,1464678000"; d="scan'208";a="753379909" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.221.30]) ([10.237.221.30]) by FMSMGA003.fm.intel.com with ESMTP; 25 Aug 2016 06:49:04 -0700 To: dev@dpdk.org References: <1472132490-27425-1-git-send-email-ferruh.yigit@intel.com> Cc: ZhouYates From: Ferruh Yigit Message-ID: <57BEF74F.6040702@intel.com> Date: Thu, 25 Aug 2016 14:49:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1472132490-27425-1-git-send-email-ferruh.yigit@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] kni: error rollback with kni_dev_remove could cause a kernel crash X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2016 13:49:06 -0000 Hi ZhouYates, On 8/25/2016 2:41 PM, Ferruh Yigit wrote: > From: ZhouYates I have re-sent your exact patch which was sent as attachment. Thank you for the patch, can you please follow contribution guide for next version of the patch? More details on: http://dpdk.org/doc/guides/contributing/patches.html#sending-patches > > Signed-off-by: ZhouYates > --- > lib/librte_eal/linuxapp/kni/kni_misc.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c > index 59d15ca..7ef17f5 100644 > --- a/lib/librte_eal/linuxapp/kni/kni_misc.c > +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c > @@ -448,7 +448,6 @@ kni_ioctl_create(struct net *net, > > kni = netdev_priv(net_dev); > > - kni->net_dev = net_dev; > kni->group_id = dev_info.group_id; > kni->core_id = dev_info.core_id; > strncpy(kni->name, dev_info.name, RTE_KNI_NAMESIZE); > @@ -561,6 +560,9 @@ kni_ioctl_create(struct net *net, > kni_dev_remove(kni); But this cause allocated net_dev not freed here ... > return -ENODEV; > } > + /*Set the kni->net_dev when the net_dev has registered success. > + * Avoid unregistering unregistered net_dev by kni_dev_remove.*/ Can you please use multi line comment syntax same as rest of the document. Or perhaps first line can be enough. > + kni->net_dev = net_dev; > > #ifdef RTE_KNI_VHOST > kni_vhost_init(kni); >