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>
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