From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2DFDE5A69 for ; Mon, 9 May 2016 10:36:12 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 09 May 2016 01:36:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,600,1455004800"; d="scan'208";a="975580359" Received: from gklab-246-025.igk.intel.com (HELO Sent) ([10.217.246.25]) by fmsmga002.fm.intel.com with SMTP; 09 May 2016 01:36:10 -0700 Received: by Sent (sSMTP sendmail emulation); Mon, 09 May 2016 11:38:58 +0200 From: Daniel Mrzyglod To: helin.zhang@intel.com Cc: dev@dpdk.org, Daniel Mrzyglod Date: Mon, 9 May 2016 11:38:30 +0200 Message-Id: <1462786710-22032-1-git-send-email-danielx.t.mrzyglod@intel.com> X-Mailer: git-send-email 2.5.5 Subject: [dpdk-dev] [PATCH] examples/kni: unchecked return value 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: Mon, 09 May 2016 08:36:13 -0000 Fix issue reported by Coverity. Coverity ID 30692 If the function returns an error value, the error value may be mistaken for a normal value. In kni_free_kni: Value returned from a function is not checked for errors before being used Fixes: b475eb0bc400 ("examples/kni: new parameters") Signed-off-by: Daniel Mrzyglod --- examples/kni/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/kni/main.c b/examples/kni/main.c index a5297f2..dcecd09 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -831,7 +831,8 @@ kni_free_kni(uint8_t port_id) return -1; for (i = 0; i < p[port_id]->nb_kni; i++) { - rte_kni_release(p[port_id]->kni[i]); + if (rte_kni_release(p[port_id]->kni[i])) + printf("fail to release kni\n"); p[port_id]->kni[i] = NULL; } rte_eth_dev_stop(port_id); -- 2.5.5