]> git.droids-corp.org - dpdk.git/blobdiff - examples/ethtool/lib/rte_ethtool.c
examples: check status of getting link info
[dpdk.git] / examples / ethtool / lib / rte_ethtool.c
index 43cacc05795ab630f1d3a7e332fa8df608b3036c..8393b0d609d5dfd375c550ef1ac1439b56cb7ef5 100644 (file)
@@ -124,9 +124,13 @@ int
 rte_ethtool_get_link(uint16_t port_id)
 {
        struct rte_eth_link link;
+       int ret;
 
        RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-       rte_eth_link_get(port_id, &link);
+       ret = rte_eth_link_get(port_id, &link);
+       if (ret < 0)
+               return ret;
+
        return link.link_status;
 }