From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id E7D5C1B067 for ; Wed, 1 Aug 2018 18:45:05 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7F37421ADF; Wed, 1 Aug 2018 12:45:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 01 Aug 2018 12:45:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=5PMS+K7BMdG1R04mLnZDQWUBBG RccA5YKFyj9KE31jg=; b=BgIkIqvAdtjz8nODx88rQHDuXt29bHOUxiNw5skTB+ hCKpXNyTYNdIv3ED+KEYmQ7Obfndc3iBtbAF3YBMYSoBAswH6JAgYjXVegtnhSaf zMS//QHQ86Y/Hj1y+R9/oq9tPEF2CVq2ZzcbtKyPULnBYy2Rm8E+m1KnuHjloxb+ E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=5PMS+K 7BMdG1R04mLnZDQWUBBGRccA5YKFyj9KE31jg=; b=M1h2vSvcfMYj+yfWbqgXBx DHdvGIBd380+KEa2+E7cSbCGYY6TKfhcCRYK6tC/wfTxn5vn28X9oymxI9YV3KLO ccIHY8TrnJeYKGhg4XP0wtQi7fVokcIjME+C0vvtryDwKnIN85E4324rytlGt8iQ p3Loi6L+wv/JbhEzw+fIERqv6ngBpbYG7e//IqG5BGmCKixy6uFu3afHqZQ7t6hS HDxAVol13oeDXKRT5vLnOZtaWYDnHf46HISqntSSQzHiW4vncRvXamCO7V0fnBmO irfoUXVtDi/DZgdxqq0yVfyIIj3RWYLxM2vFJ/pCQbFmAQJK1N0u9aXjTDKaNaAw == X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B3AC1025D; Wed, 1 Aug 2018 12:45:03 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, Dan Gora , marc.sune@bisdn.de Date: Wed, 01 Aug 2018 18:44:58 +0200 Message-ID: <2698225.a6zRWv2j3G@xps> In-Reply-To: <20180628225838.22732-1-dg@adax.com> References: <20180628225838.22732-1-dg@adax.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 1/1] kni: fix segfault in rte_kni_get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2018 16:45:06 -0000 This patch is missing review. 29/06/2018 00:58, Dan Gora: > Fix a segmentation fault which occurs when the kni_autotest is run > in the 'test' application. > > This segmenation fault occurs when rte_kni_get() is called with a > NULL value for 'name'. > > Fixes: 0c6bc8ef70ba ("kni: memzone pool for alloc and release") > Cc: marc.sune@bisdn.de > > Signed-off-by: Dan Gora > --- > lib/librte_kni/rte_kni.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c > index aa3559306..c4199e6ab 100644 > --- a/lib/librte_kni/rte_kni.c > +++ b/lib/librte_kni/rte_kni.c > @@ -744,6 +744,9 @@ rte_kni_get(const char *name) > struct rte_kni_memzone_slot *it; > struct rte_kni *kni; > > + if (name == NULL || name[0] == '\0') > + return NULL; > + > /* Note: could be improved perf-wise if necessary */ > for (i = 0; i < kni_memzone_pool.max_ifaces; i++) { > it = &kni_memzone_pool.slots[i]; >