ethdev: fix unchecked return value
authorSlawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Thu, 7 Apr 2016 11:46:32 +0000 (13:46 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 7 Apr 2016 17:11:16 +0000 (19:11 +0200)
It fix coverity issue:
CID 124557 (#1 of 1): Unchecked return value (CHECKED_RETURN)
check_return: Calling rte_eth_tx_buffer_set_err_callback without
checking return value (as is done elsewhere 6 out of 7 times).

Fixes: d6c99e62c852 ("ethdev: add buffered Tx")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
lib/librte_ether/rte_ethdev.c

index bd54e1f..a31018e 100644 (file)
@@ -1342,15 +1342,18 @@ rte_eth_tx_buffer_set_err_callback(struct rte_eth_dev_tx_buffer *buffer,
 int
 rte_eth_tx_buffer_init(struct rte_eth_dev_tx_buffer *buffer, uint16_t size)
 {
+       int ret = 0;
+
        if (buffer == NULL)
                return -EINVAL;
 
        buffer->size = size;
-       if (buffer->error_callback == NULL)
-               rte_eth_tx_buffer_set_err_callback(buffer,
-                               rte_eth_tx_buffer_drop_callback, NULL);
+       if (buffer->error_callback == NULL) {
+               ret = rte_eth_tx_buffer_set_err_callback(
+                       buffer, rte_eth_tx_buffer_drop_callback, NULL);
+       }
 
-       return 0;
+       return ret;
 }
 
 void