[PATCH 1/2] net/ionic: fix up minor coverity issue in queue allocation
Andrew Boyer
andrew.boyer at amd.com
Thu Nov 3 14:49:08 CET 2022
(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 at 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
More information about the dev
mailing list