net/softnic: fix unchecked return value

Message ID 20190404154542.48110-1-jasvinder.singh@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/softnic: fix unchecked return value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Jasvinder Singh April 4, 2019, 3:45 p.m. UTC
  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(-)
  

Comments

Rami Rosen April 4, 2019, 5:20 p.m. UTC | #1
Acked-by: Rami Rosen <ramirose@gmail.com>
  
Ferruh Yigit April 4, 2019, 5:34 p.m. UTC | #2
On 4/4/2019 4:45 PM, Jasvinder Singh wrote:
> 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>

Acked-by: Rami Rosen <ramirose@gmail.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

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,