DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
To: <dev@dpdk.org>
Cc: Pavan Nikhilesh <pbhagavatula@marvell.com>,
	Shijith Thotton <sthotton@marvell.com>, <jerinj@marvell.com>,
	Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Subject: [PATCH 3/3] event/cnxk: fix uninitialized local variable
Date: Sat, 12 Feb 2022 18:09:48 +0530	[thread overview]
Message-ID: <20220212123948.3394407-3-gmuthukrishn@marvell.com> (raw)
In-Reply-To: <20220212123948.3394407-1-gmuthukrishn@marvell.com>

Fix uninitialized local variable as reported in coverity scan.

Fixes: 300b796262a ("event/cnxk: add timer arm routine")
Fixes: 300b796262a ("event/cnxk: add timer arm routine"
Coverity issue: 370578, 370579, 370587

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 drivers/event/cnxk/cnxk_tim_worker.c | 2 +-
 drivers/event/cnxk/cnxk_tim_worker.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/event/cnxk/cnxk_tim_worker.c b/drivers/event/cnxk/cnxk_tim_worker.c
index 3ce99864a6..dfcfbdc797 100644
--- a/drivers/event/cnxk/cnxk_tim_worker.c
+++ b/drivers/event/cnxk/cnxk_tim_worker.c
@@ -63,7 +63,7 @@ cnxk_tim_timer_arm_burst(const struct rte_event_timer_adapter *adptr,
 	struct cnxk_tim_ring *tim_ring = adptr->data->adapter_priv;
 	struct cnxk_tim_ent entry;
 	uint16_t index;
-	int ret;
+	int ret = 0;
 
 	cnxk_tim_sync_start_cyc(tim_ring);
 	for (index = 0; index < nb_timers; index++) {
diff --git a/drivers/event/cnxk/cnxk_tim_worker.h b/drivers/event/cnxk/cnxk_tim_worker.h
index 78e36ffafe..0c9f29cfbe 100644
--- a/drivers/event/cnxk/cnxk_tim_worker.h
+++ b/drivers/event/cnxk/cnxk_tim_worker.h
@@ -233,8 +233,8 @@ cnxk_tim_add_entry_sp(struct cnxk_tim_ring *const tim_ring,
 		      const struct cnxk_tim_ent *const pent,
 		      const uint8_t flags)
 {
+	struct cnxk_tim_ent *chunk = NULL;
 	struct cnxk_tim_bkt *mirr_bkt;
-	struct cnxk_tim_ent *chunk;
 	struct cnxk_tim_bkt *bkt;
 	uint64_t lock_sema;
 	int16_t rem;
@@ -316,8 +316,8 @@ cnxk_tim_add_entry_mp(struct cnxk_tim_ring *const tim_ring,
 		      const struct cnxk_tim_ent *const pent,
 		      const uint8_t flags)
 {
+	struct cnxk_tim_ent *chunk = NULL;
 	struct cnxk_tim_bkt *mirr_bkt;
-	struct cnxk_tim_ent *chunk;
 	struct cnxk_tim_bkt *bkt;
 	uint64_t lock_sema;
 	int64_t rem;
-- 
2.25.1


  parent reply	other threads:[~2022-02-12 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-12 12:39 [PATCH 1/3] event/cnxk: fix incompatible casting of variables Gowrishankar Muthukrishnan
2022-02-12 12:39 ` [PATCH 2/3] event/cnxk: fix memory leak Gowrishankar Muthukrishnan
2022-02-12 12:39 ` Gowrishankar Muthukrishnan [this message]
2022-02-22  9:50 ` [PATCH 1/3] event/cnxk: fix incompatible casting of variables Jerin Jacob

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=20220212123948.3394407-3-gmuthukrishn@marvell.com \
    --to=gmuthukrishn@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=pbhagavatula@marvell.com \
    --cc=sthotton@marvell.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).