From: Cheryl Bansal <cheryl.bansal@altera.com>
To: Yipeng Wang <yipeng1.wang@intel.com>,
Sameh Gobriel <sameh.gobriel@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>,
Vladimir Medvedkin <vladimir.medvedkin@intel.com>,
Chenbo Xia <chenbox@nvidia.com>,
Nipun Gupta <nipun.gupta@amd.com>
Cc: dev@dpdk.org, stable@dpdk.org, Cheryl Bansal <cheryl.bansal@altera.com>
Subject: [PATCH 1/2] hash: fix maybe-uninitialized warning on minsize build
Date: Mon, 23 Nov 2026 11:43:18 +0530 [thread overview]
Message-ID: <20261123061319.163645-1-cheryl.bansal@altera.com> (raw)
With --buildtype=minsize and -Werror, gcc reports that slot_id may be
used uninitialized in alloc_slot(). This is a false positive: every
path either returns EMPTY_SLOT or assigns slot_id before use.
Initialize slot_id to EMPTY_SLOT to silence the warning.
Fixes: 5915699153d7 ("hash: fix scaling by reducing contention")
Cc: stable@dpdk.org
Signed-off-by: Cheryl Bansal <cheryl.bansal@altera.com>
---
.mailmap | 1 +
lib/hash/rte_cuckoo_hash.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.mailmap b/.mailmap
index a0096fb97a..5146a4fa2b 100644
--- a/.mailmap
+++ b/.mailmap
@@ -288,6 +288,7 @@ Chenna Arnoori <chenna.arnoori@broadcom.com>
Chenxingyu Wang <wangchenxingyu@huawei.com>
Chenxu Di <chenxux.di@intel.com>
Chenyu Huang <chenyux.huang@intel.com>
+Cheryl Bansal <cheryl.bansal@altera.com>
Cheryl Houser <chouser@vmware.com>
Chinh Cao <chinh.t.cao@intel.com>
Chintu Hetam <rometoroam@gmail.com>
diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 5d495ae973..47ea909d38 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -1298,7 +1298,7 @@ static inline uint32_t
alloc_slot(const struct rte_hash *h, struct lcore_cache *cached_free_slots)
{
unsigned int n_slots;
- uint32_t slot_id;
+ uint32_t slot_id = EMPTY_SLOT;
if (h->use_local_cache) {
/* Try to get a free slot from the local cache */
--
2.43.0
next reply other threads:[~2026-11-23 6:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 6:13 Cheryl Bansal [this message]
2026-11-23 6:13 ` [PATCH 2/2] bus/pci: add selective BAR mapping support Cheryl Bansal
2026-11-23 7:57 ` David Marchand
2026-11-23 17:03 ` Stephen Hemminger
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=20261123061319.163645-1-cheryl.bansal@altera.com \
--to=cheryl.bansal@altera.com \
--cc=bruce.richardson@intel.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=nipun.gupta@amd.com \
--cc=sameh.gobriel@intel.com \
--cc=stable@dpdk.org \
--cc=vladimir.medvedkin@intel.com \
--cc=yipeng1.wang@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