From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jasvinder.singh@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 3ECDB1B3BC
 for <dev@dpdk.org>; Thu,  4 Apr 2019 17:45:45 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga006.fm.intel.com ([10.253.24.20])
 by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 04 Apr 2019 08:45:44 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,308,1549958400"; d="scan'208";a="333802851"
Received: from silpixa00381635.ir.intel.com (HELO
 silpixa00381635.ger.corp.intel.com) ([10.237.222.149])
 by fmsmga006.fm.intel.com with ESMTP; 04 Apr 2019 08:45:43 -0700
From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com
Date: Thu,  4 Apr 2019 16:45:42 +0100
Message-Id: <20190404154542.48110-1-jasvinder.singh@intel.com>
X-Mailer: git-send-email 2.17.1
Subject: [dpdk-dev] [PATCH] net/softnic: fix unchecked return value
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 04 Apr 2019 15:45:45 -0000

Fix unchecked return value issue reported by Coverity.

Coverity ID 336852
Fixes: a958a5c07f4b ("net/softnic: support service cores")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 drivers/net/softnic/rte_eth_softnic_thread.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index 57989a5aa..855408e98 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -137,7 +137,10 @@ thread_sc_service_up(struct pmd_internals *softnic, uint32_t thread_id)
 	uint16_t port_id;
 
 	/* service params */
-	rte_eth_dev_get_port_by_name(softnic->params.name, &port_id);
+	status = rte_eth_dev_get_port_by_name(softnic->params.name, &port_id);
+	if (status)
+		return status;
+
 	dev = &rte_eth_devices[port_id];
 	snprintf(service_params.name, sizeof(service_params.name), "%s_%u",
 		softnic->params.name,
-- 
2.17.1

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 585EAA0679
	for <public@inbox.dpdk.org>; Thu,  4 Apr 2019 17:45:48 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id C97521B419;
	Thu,  4 Apr 2019 17:45:46 +0200 (CEST)
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 3ECDB1B3BC
 for <dev@dpdk.org>; Thu,  4 Apr 2019 17:45:45 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga006.fm.intel.com ([10.253.24.20])
 by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 04 Apr 2019 08:45:44 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,308,1549958400"; d="scan'208";a="333802851"
Received: from silpixa00381635.ir.intel.com (HELO
 silpixa00381635.ger.corp.intel.com) ([10.237.222.149])
 by fmsmga006.fm.intel.com with ESMTP; 04 Apr 2019 08:45:43 -0700
From: Jasvinder Singh <jasvinder.singh@intel.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com
Date: Thu,  4 Apr 2019 16:45:42 +0100
Message-Id: <20190404154542.48110-1-jasvinder.singh@intel.com>
X-Mailer: git-send-email 2.17.1
Subject: [dpdk-dev] [PATCH] net/softnic: fix unchecked return value
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <20190404154542.mxyOHcG73EZwkK9n-rEnAq-nIns0ckyhDrzSQmiwJ7c@z>

Fix unchecked return value issue reported by Coverity.

Coverity ID 336852
Fixes: a958a5c07f4b ("net/softnic: support service cores")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 drivers/net/softnic/rte_eth_softnic_thread.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c
index 57989a5aa..855408e98 100644
--- a/drivers/net/softnic/rte_eth_softnic_thread.c
+++ b/drivers/net/softnic/rte_eth_softnic_thread.c
@@ -137,7 +137,10 @@ thread_sc_service_up(struct pmd_internals *softnic, uint32_t thread_id)
 	uint16_t port_id;
 
 	/* service params */
-	rte_eth_dev_get_port_by_name(softnic->params.name, &port_id);
+	status = rte_eth_dev_get_port_by_name(softnic->params.name, &port_id);
+	if (status)
+		return status;
+
 	dev = &rte_eth_devices[port_id];
 	snprintf(service_params.name, sizeof(service_params.name), "%s_%u",
 		softnic->params.name,
-- 
2.17.1