Skip to content

Commit

Permalink
net/ring: fix return value check
Browse files Browse the repository at this point in the history
[ upstream commit e0474b9 ]

'rte_eth_dev_get_port_by_name()' return value is not checked caught by
coverity, adding return value check.

Coverity issue: 305853
Fixes: 96cb195 ("net/ring: use EAL APIs in PMD specific API")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
Ferruh Yigit authored and kevintraynor committed May 8, 2019
1 parent b3dfc99 commit 99a6560
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ring/rte_eth_ring.c
Expand Up @@ -396,7 +396,11 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
return -1;
}

rte_eth_dev_get_port_by_name(ring_name, &port_id);
ret = rte_eth_dev_get_port_by_name(ring_name, &port_id);
if (ret) {
rte_errno = ENODEV;
return -1;
}

return port_id;
}
Expand Down

0 comments on commit 99a6560

Please sign in to comment.