From: Thomas Monjalon Date: Fri, 16 Nov 2018 16:58:53 +0000 (+0100) Subject: eventdev: fix possible uninitialized variable X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6b8d9a4b4c611f3319c639145ab21574a21944b9;p=dpdk.git 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 --- diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c index 3a21defba1..ccf8a7550e 100644 --- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c @@ -702,7 +702,7 @@ txa_service_queue_add(uint8_t id, struct txa_service_queue_info *tqi; struct rte_eth_dev_tx_buffer *tb; struct txa_retry *txa_retry; - int ret; + int ret = 0; txa = txa_service_id_to_data(id);