[1/2] net/ionic: fix up minor coverity issue in queue allocation

Message ID 20221103134909.21791-2-andrew.boyer@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series net/ionic: fix up minor coverity issues |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Boyer Nov. 3, 2022, 1:49 p.m. UTC
  (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(-)
  

Patch

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;