From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 1/1] kni: fix segfault in rte_kni_get Date: Wed, 01 Aug 2018 18:44:58 +0200 Message-ID: <2698225.a6zRWv2j3G@xps> References: <20180628225838.22732-1-dg@adax.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Dan Gora , marc.sune@bisdn.de To: Ferruh Yigit 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) In-Reply-To: <20180628225838.22732-1-dg@adax.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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]; >