eventdev: fix possible uninitialized variable
authorThomas Monjalon <thomas@monjalon.net>
Fri, 16 Nov 2018 16:58:53 +0000 (17:58 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 23 Nov 2018 00:43:42 +0000 (01:43 +0100)
commit6b8d9a4b4c611f3319c639145ab21574a21944b9
treeecce8e36b7cefbe31761858b74679d3dd2e932cb
parent554f06d10b1c646f20d7011a30b26fb43507d596
eventdev: fix possible uninitialized variable

When compiling with -O1, this error can appear:
lib/librte_eventdev/rte_event_eth_tx_adapter.c:705:6: error:
‘ret’ may be used uninitialized in this function

If tx_queue_id is -1 and nb_queues is 0, then ret is returned
without being initialized.
It is fixed by setting 0 as initial value.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
lib/librte_eventdev/rte_event_eth_tx_adapter.c