app/testpmd: check MAC address query

This patch checks return value for rte_eth_dev_info_get() in show_macs().

Coverity issue: 353629
Fixes: e1d44d0ad623 ("app/testpmd: show MAC addresses added to a port")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
This commit is contained in:
Kalesh AP 2021-03-16 12:21:36 +05:30 committed by Ferruh Yigit
parent 71f5872dd1
commit 2382a60759

View File

@ -4930,7 +4930,8 @@ show_macs(portid_t port_id)
dev = &rte_eth_devices[port_id];
rte_eth_dev_info_get(port_id, &dev_info);
if (eth_dev_info_get_print_err(port_id, &dev_info))
return;
for (i = 0; i < dev_info.max_mac_addrs; i++) {
addr = &dev->data->mac_addrs[i];