DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: pbhagavatula@caviumnetworks.com
Subject: [dpdk-dev] [PATCH 5/5] app/eventdev: fix possible uninitialized variable
Date: Fri, 16 Nov 2018 17:58:54 +0100	[thread overview]
Message-ID: <20181116165854.24017-6-thomas@monjalon.net> (raw)
In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net>

When compiling with -O1, this error can appear:
	app/test-eventdev/test_pipeline_common.c:332:6: error:
	‘ret’ may be used uninitialized in this function

If there is no device, then ret is returned without being initialized.
It is fixed by setting 0 as initial value.

Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter")
Cc: pbhagavatula@caviumnetworks.com

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-eventdev/test_pipeline_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index d07fa8826..5db3ffde1 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -329,7 +329,7 @@ int
 pipeline_event_tx_adapter_setup(struct evt_options *opt,
 		struct rte_event_port_conf port_conf)
 {
-	int ret;
+	int ret = 0;
 	uint16_t consm;
 
 	RTE_ETH_FOREACH_DEV(consm) {
-- 
2.19.0

  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 ` [dpdk-dev] [PATCH 4/5] eventdev: " Thomas Monjalon
2018-11-16 16:58 ` Thomas Monjalon [this message]
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-6-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=dev@dpdk.org \
    --cc=pbhagavatula@caviumnetworks.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).