From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH 4/5] eventdev: fix possible uninitialized variable Date: Fri, 16 Nov 2018 17:58:53 +0100 Message-ID: <20181116165854.24017-5-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: nikhil.rao@intel.com To: dev@dpdk.org Return-path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 628BC4F9B for ; Fri, 16 Nov 2018 17:59:11 +0100 (CET) In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Cc: nikhil.rao@intel.com Signed-off-by: Thomas Monjalon --- lib/librte_eventdev/rte_event_eth_tx_adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c index 3a21defba..ccf8a7550 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); -- 2.19.0