Skip to contentSkip to conversation

eventdev: fix build error

PATCH In review Ferruh Yigit 2 participants 2 messages Oct 9, 2018 – Oct 10, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eventdev: fix build error

build error:
.../lib/librte_eventdev/rte_event_eth_tx_adapter.c:
In function ‘txa_service_queue_del’:
.../lib/librte_eventdev/rte_event_eth_tx_adapter.c:800:7:
error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
compilation terminated due to -Wfatal-errors.

https://mails.dpdk.org/archives/test-report/2018-October/065919.html

'ret' may be used uninitialized when 'dev->data->nb_tx_queues' is 0, although this is not a practical value, initialize 'ret' to cover this case.

Fixes a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
---
 lib/librte_eventdev/rte_event_eth_tx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eventdev/rte_event_eth_tx_adapter.c +1 -1
index aae0378d5..3a21defba 100644
@@ -797,7 +797,7 @@ txa_service_queue_del(uint8_t id,
 
 	if (tx_queue_id == -1) {
 		uint16_t i;
-		int ret;
+		int ret = -1;
 
 		for (i = 0; i < dev->data->nb_tx_queues; i++) {
 			ret = txa_service_queue_del(id, dev, i);
Signature · 1 line
2.17.1
#1 lore raw

09/10/2018 12:13, Ferruh Yigit:

Quoted 8 lines

build error:
.../lib/librte_eventdev/rte_event_eth_tx_adapter.c:
In function ‘txa_service_queue_del’:
.../lib/librte_eventdev/rte_event_eth_tx_adapter.c:800:7:
error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
compilation terminated due to -Wfatal-errors.

Quoted 8 lines

https://mails.dpdk.org/archives/test-report/2018-October/065919.html

'ret' may be used uninitialized when 'dev->data->nb_tx_queues' is 0, although this is not a practical value, initialize 'ret' to cover this case.

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

The root cause is a new feature in 18.11, so no need to Cc stable.

Quoted 1 line

Applied (without stable backport tag), thanks