From: Andrew Boyer <andrew.boyer@amd.com>
To: <dev@dpdk.org>
Cc: Andrew Boyer <andrew.boyer@amd.com>
Subject: [PATCH 1/2] net/ionic: fix up minor coverity issue in queue allocation
Date: Thu, 3 Nov 2022 06:49:08 -0700 [thread overview]
Message-ID: <20221103134909.21791-2-andrew.boyer@amd.com> (raw)
In-Reply-To: <20221103134909.21791-1-andrew.boyer@amd.com>
(uint16_t * uint16_t) promoted to uint64_t has a sign extension
problem reported by Coverity. Cast one arg to uint64_t first
to eliminate the sign extension.
Coverity issue: 381617
Coverity issue: 381618
Fixes: 7b20fc2f3c06 ("net/ionic: overhaul Rx for performance")
Signed-off-by: Andrew Boyer <andrew.boyer@amd.com>
---
drivers/net/ionic/ionic_lif.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c
index 63635a4b19..25b490deb6 100644
--- a/drivers/net/ionic/ionic_lif.c
+++ b/drivers/net/ionic/ionic_lif.c
@@ -610,8 +610,8 @@ ionic_qcq_alloc(struct ionic_lif *lif,
/* Most queue types will store 1 ptr per descriptor */
new->q.info = rte_calloc_socket("ionic",
- num_descs * num_segs, sizeof(void *),
- page_size, socket_id);
+ (uint64_t)num_descs * num_segs,
+ sizeof(void *), page_size, socket_id);
if (!new->q.info) {
IONIC_PRINT(ERR, "Cannot allocate queue info");
err = -ENOMEM;
--
2.17.1
next prev parent reply other threads:[~2022-11-03 13:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 13:49 [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Boyer
2022-11-03 13:49 ` Andrew Boyer [this message]
2022-11-03 13:49 ` [PATCH 2/2] net/ionic: fix up minor coverity issue in packet transmit Andrew Boyer
2022-11-06 9:28 ` [PATCH 0/2] net/ionic: fix up minor coverity issues Andrew Rybchenko
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=20221103134909.21791-2-andrew.boyer@amd.com \
--to=andrew.boyer@amd.com \
--cc=dev@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).