patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Rakesh Kudurumalla <rkudurumalla@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>,
	Rakesh Kudurumalla <rkudurumalla@marvell.com>, <stable@dpdk.org>,
	Ferruh Yigit <ferruh.yigit@intel.com>
Subject: [PATCH] net/cnxk: fix error when compiled for x86
Date: Fri, 4 Mar 2022 19:53:37 +0530	[thread overview]
Message-ID: <20220304142337.911828-1-rkudurumalla@marvell.com> (raw)

fix error when compiled for x86 platform when compiled
with optimization flag enabled
error: ‘str’ may be used uninitialized in this function
error: ‘frag_ptr’ may be used uninitialized in this function

Bugzilla ID: 939
Fixes: b526599020ef ("net/cnxk: fix build with GCC 12")
Cc: stable@dpdk.org

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
---
 drivers/net/cnxk/cn10k_rx.h        | 5 +++--
 drivers/net/cnxk/cnxk_ethdev_mtr.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 7f219e5ddd..e4f5a553a6 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -146,7 +146,8 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
 	uint32_t offset = hdr->w2.fi_offset;
 	union nix_rx_parse_u *frag_rx;
 	struct cpt_frag_info_s *finfo;
-	uint64_t *frag_ptr, ol_flags;
+	uint64_t *frag_ptr = NULL;
+	uint64_t ol_flags;
 	uint16_t frag_size;
 	uint16_t rlen;
 	uint64_t *wqe;
@@ -276,8 +277,8 @@ nix_sec_reassemble_frags(const struct cpt_parse_hdr_s *hdr, uint64_t cq_w1,
 	union nix_rx_parse_u *frag_rx;
 	struct cpt_frag_info_s *finfo;
 	struct rte_mbuf *head, *mbuf;
+	uint64_t *frag_ptr = NULL;
 	rte_iova_t *inner_iova;
-	uint64_t *frag_ptr;
 	uint16_t frag_size;
 	uint64_t *wqe;
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c
index c8183aa12d..02803bdf75 100644
--- a/drivers/net/cnxk/cnxk_ethdev_mtr.c
+++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c
@@ -288,7 +288,7 @@ cnxk_nix_mtr_profile_delete(struct rte_eth_dev *eth_dev, uint32_t profile_id,
 static int
 update_mtr_err(uint32_t act_color, struct rte_mtr_error *error, bool action)
 {
-	const char *str;
+	const char *str = NULL;
 	switch (act_color) {
 	case RTE_COLOR_GREEN:
 		if (action) {
-- 
2.25.1


             reply	other threads:[~2022-03-04 14:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 14:23 Rakesh Kudurumalla [this message]
2022-03-07  6:51 ` Gao, DaxueX
2022-03-10  1:35 ` Jiang, YuX
2022-03-10  8:48   ` Jerin Jacob
2022-03-16  3:32     ` Gao, DaxueX
2022-03-16  4:42       ` Jerin Jacob
2022-03-16 12:41       ` Kevin Traynor

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=20220304142337.911828-1-rkudurumalla@marvell.com \
    --to=rkudurumalla@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=stable@dpdk.org \
    /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).