examples/ethtool: fix unchecked return value
PATCH 1/1 examples/ethtool: fix unchecked return value
This checks the return value from the functionrte_eth_dev_set_vlan_offload.
Coverity issue: 350358
Fixes bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Signed-off-by Gargi Sau <[email protected]>
--- examples/ethtool/lib/rte_ethtool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
examples/ethtool/lib/rte_ethtool.c +3 -1
@@ -402,7 +402,9 @@ rte_ethtool_net_set_rx_mode(uint16_t port_id) }/* Enable Rx vlan filter, VF unspport status is discard */ -rte_eth_dev_set_vlan_offload (port_id,ETH_VLAN_FILTER_MASK ); + ret =rte_eth_dev_set_vlan_offload (port_id,ETH_VLAN_FILTER_MASK ); +if (ret !=0 ) +return ret;return 0 ; }
Signature · 1 line
2.17.1
Quoted 17 lines · Gargi Sau
This checks the return value from the function
rte_eth_dev_set_vlan_offload.Coverity issue: 350358
Fixes bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")Signed-off-by Gargi Sau <[email protected]>--- examples/ethtool/lib/rte_ethtool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)examples/ethtool/lib/rte_ethtool.c +0
-0
examples/ethtool/lib/rte_ethtool.c rte_ethtool_net_set_rx_mode(uint16_t port_id) · line 408
Quoted 8 lines
examples/ethtool/lib/rte_ethtool.c +3
-1@@ -402,7 +402,9 @@ rte_ethtool_net_set_rx_mode(uint16_t port_id) }/* Enable Rx vlan filter, VF unspport status is discard */ -rte_eth_dev_set_vlan_offload (port_id,ETH_VLAN_FILTER_MASK ); + ret =rte_eth_dev_set_vlan_offload (port_id,ETH_VLAN_FILTER_MASK ); +if (ret !=0 ) +return ret;
Looks ok to me.
Acked-by Bruce Richardson <[email protected]>
David Marchand
AppliedQuoted 29 lines · Bruce Richardson
Quoted 17 lines · Gargi Sau
This checks the return value from the function
rte_eth_dev_set_vlan_offload.Coverity issue: 350358
Fixes bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")Signed-off-by Gargi Sau <[email protected]>--- examples/ethtool/lib/rte_ethtool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)examples/ethtool/lib/rte_ethtool.c +0
-0examples/ethtool/lib/rte_ethtool.c rte_ethtool_net_set_rx_mode(uint16_t port_id) · line 408
Quoted 8 lines
examples/ethtool/lib/rte_ethtool.c +3
-1@@ -402,7 +402,9 @@ rte_ethtool_net_set_rx_mode(uint16_t port_id) }/* Enable Rx vlan filter, VF unspport status is discard */ -rte_eth_dev_set_vlan_offload (port_id,ETH_VLAN_FILTER_MASK ); + ret =rte_eth_dev_set_vlan_offload (port_id,ETH_VLAN_FILTER_MASK ); +if (ret !=0 ) +return ret;Looks ok to me.
Quoted 1 line
Acked-by Bruce Richardson <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand