From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: nikhil.rao@intel.com
Subject: [dpdk-dev] [PATCH 4/5] eventdev: fix possible uninitialized variable
Date: Fri, 16 Nov 2018 17:58:53 +0100 [thread overview]
Message-ID: <20181116165854.24017-5-thomas@monjalon.net> (raw)
In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net>
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 <thomas@monjalon.net>
---
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
next prev parent reply other threads:[~2018-11-16 16:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 16:58 [dpdk-dev] [PATCH 0/5] fix build with option -O1 Thomas Monjalon
2018-11-16 16:58 ` [dpdk-dev] [PATCH 1/5] eal: fix build with -O1 Thomas Monjalon
2018-11-16 16:58 ` [dpdk-dev] [PATCH 2/5] kni: fix possible uninitialized variable Thomas Monjalon
2018-11-16 16:58 ` [dpdk-dev] [PATCH 3/5] net/mlx4: " Thomas Monjalon
2018-11-16 16:58 ` Thomas Monjalon [this message]
2018-11-16 16:58 ` [dpdk-dev] [PATCH 5/5] app/eventdev: " Thomas Monjalon
2018-11-23 0:26 ` [dpdk-dev] [PATCH 0/5] fix build with option -O1 Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181116165854.24017-5-thomas@monjalon.net \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=nikhil.rao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).