patch 'bus/fslmc: fix Coverity warnings in QBMAN' has been queued to stable release 21.11.9

Kevin Traynor ktraynor at redhat.com
Wed Nov 27 18:18:28 CET 2024


Hi,

FYI, your patch has been queued to stable release 21.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/02/24. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/e00b805528a35aeaa44dab06b793facfb8fca7d3

Thanks.

Kevin

---
>From e00b805528a35aeaa44dab06b793facfb8fca7d3 Mon Sep 17 00:00:00 2001
From: Rohit Raj <rohit.raj at nxp.com>
Date: Wed, 23 Oct 2024 17:29:32 +0530
Subject: [PATCH] bus/fslmc: fix Coverity warnings in QBMAN

[ upstream commit 051f4185f98faa964b6a965b2e8e7b2da68969de ]

Fix Issues reported by NXP Internal Coverity.

Fixes: 64f131a82fbe ("bus/fslmc: add qbman debug")

Signed-off-by: Rohit Raj <rohit.raj at nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/bus/fslmc/qbman/qbman_debug.c | 49 +++++++++++++++++----------
 1 file changed, 32 insertions(+), 17 deletions(-)

diff --git a/drivers/bus/fslmc/qbman/qbman_debug.c b/drivers/bus/fslmc/qbman/qbman_debug.c
index eea06988ff..0e471ec3fd 100644
--- a/drivers/bus/fslmc/qbman/qbman_debug.c
+++ b/drivers/bus/fslmc/qbman/qbman_debug.c
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright (C) 2015 Freescale Semiconductor, Inc.
- * Copyright 2018-2020 NXP
+ * Copyright 2018-2020,2022 NXP
  */
 
@@ -38,4 +38,5 @@ int qbman_bp_query(struct qbman_swp *s, uint32_t bpid,
 {
 	struct qbman_bp_query_desc *p;
+	struct qbman_bp_query_rslt *bp_query_rslt;
 
 	/* Start the management command */
@@ -48,7 +49,7 @@ int qbman_bp_query(struct qbman_swp *s, uint32_t bpid,
 
 	/* Complete the management command */
-	*r = *(struct qbman_bp_query_rslt *)qbman_swp_mc_complete(s, p,
-						 QBMAN_BP_QUERY);
-	if (!r) {
+	bp_query_rslt = (struct qbman_bp_query_rslt *)qbman_swp_mc_complete(s,
+						p, QBMAN_BP_QUERY);
+	if (!bp_query_rslt) {
 		pr_err("qbman: Query BPID %d failed, no response\n",
 			bpid);
@@ -56,4 +57,6 @@ int qbman_bp_query(struct qbman_swp *s, uint32_t bpid,
 	}
 
+	*r = *bp_query_rslt;
+
 	/* Decode the outcome */
 	QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_BP_QUERY);
@@ -203,4 +206,5 @@ int qbman_fq_query(struct qbman_swp *s, uint32_t fqid,
 {
 	struct qbman_fq_query_desc *p;
+	struct qbman_fq_query_rslt *fq_query_rslt;
 
 	p = (struct qbman_fq_query_desc *)qbman_swp_mc_start(s);
@@ -209,7 +213,7 @@ int qbman_fq_query(struct qbman_swp *s, uint32_t fqid,
 
 	p->fqid = fqid;
-	*r = *(struct qbman_fq_query_rslt *)qbman_swp_mc_complete(s, p,
-					  QBMAN_FQ_QUERY);
-	if (!r) {
+	fq_query_rslt = (struct qbman_fq_query_rslt *)qbman_swp_mc_complete(s,
+					p, QBMAN_FQ_QUERY);
+	if (!fq_query_rslt) {
 		pr_err("qbman: Query FQID %d failed, no response\n",
 			fqid);
@@ -217,4 +221,6 @@ int qbman_fq_query(struct qbman_swp *s, uint32_t fqid,
 	}
 
+	*r = *fq_query_rslt;
+
 	/* Decode the outcome */
 	QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_FQ_QUERY);
@@ -399,4 +405,5 @@ int qbman_cgr_query(struct qbman_swp *s, uint32_t cgid,
 {
 	struct qbman_cgr_query_desc *p;
+	struct qbman_cgr_query_rslt *cgr_query_rslt;
 
 	p = (struct qbman_cgr_query_desc *)qbman_swp_mc_start(s);
@@ -405,7 +412,7 @@ int qbman_cgr_query(struct qbman_swp *s, uint32_t cgid,
 
 	p->cgid = cgid;
-	*r = *(struct qbman_cgr_query_rslt *)qbman_swp_mc_complete(s, p,
-							QBMAN_CGR_QUERY);
-	if (!r) {
+	cgr_query_rslt = (struct qbman_cgr_query_rslt *)qbman_swp_mc_complete(s,
+					p, QBMAN_CGR_QUERY);
+	if (!cgr_query_rslt) {
 		pr_err("qbman: Query CGID %d failed, no response\n",
 			cgid);
@@ -413,4 +420,6 @@ int qbman_cgr_query(struct qbman_swp *s, uint32_t cgid,
 	}
 
+	*r = *cgr_query_rslt;
+
 	/* Decode the outcome */
 	QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_CGR_QUERY);
@@ -474,4 +483,5 @@ int qbman_cgr_wred_query(struct qbman_swp *s, uint32_t cgid,
 {
 	struct qbman_cgr_query_desc *p;
+	struct qbman_wred_query_rslt *wred_query_rslt;
 
 	p = (struct qbman_cgr_query_desc *)qbman_swp_mc_start(s);
@@ -480,7 +490,7 @@ int qbman_cgr_wred_query(struct qbman_swp *s, uint32_t cgid,
 
 	p->cgid = cgid;
-	*r = *(struct qbman_wred_query_rslt *)qbman_swp_mc_complete(s, p,
-							QBMAN_WRED_QUERY);
-	if (!r) {
+	wred_query_rslt = (struct qbman_wred_query_rslt *)qbman_swp_mc_complete(
+					s, p, QBMAN_WRED_QUERY);
+	if (!wred_query_rslt) {
 		pr_err("qbman: Query CGID WRED %d failed, no response\n",
 			cgid);
@@ -488,4 +498,6 @@ int qbman_cgr_wred_query(struct qbman_swp *s, uint32_t cgid,
 	}
 
+	*r = *wred_query_rslt;
+
 	/* Decode the outcome */
 	QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_WRED_QUERY);
@@ -528,5 +540,5 @@ void qbman_cgr_attr_wred_dp_decompose(uint32_t dp, uint64_t *minth,
 		*maxth = ma;
 	else
-		*maxth = ((ma+256) * (1<<(mn-1)));
+		*maxth = ((uint64_t)(ma+256) * (1<<(mn-1)));
 
 	if (step_s == 0)
@@ -631,4 +643,5 @@ int qbman_wqchan_query(struct qbman_swp *s, uint16_t chanid,
 {
 	struct qbman_wqchan_query_desc *p;
+	struct qbman_wqchan_query_rslt *wqchan_query_rslt;
 
 	/* Start the management command */
@@ -641,7 +654,7 @@ int qbman_wqchan_query(struct qbman_swp *s, uint16_t chanid,
 
 	/* Complete the management command */
-	*r = *(struct qbman_wqchan_query_rslt *)qbman_swp_mc_complete(s, p,
-							QBMAN_WQ_QUERY);
-	if (!r) {
+	wqchan_query_rslt = (struct qbman_wqchan_query_rslt *)qbman_swp_mc_complete(
+						s, p, QBMAN_WQ_QUERY);
+	if (!wqchan_query_rslt) {
 		pr_err("qbman: Query WQ Channel %d failed, no response\n",
 			chanid);
@@ -649,4 +662,6 @@ int qbman_wqchan_query(struct qbman_swp *s, uint16_t chanid,
 	}
 
+	*r = *wqchan_query_rslt;
+
 	/* Decode the outcome */
 	QBMAN_BUG_ON((r->verb & QBMAN_RESPONSE_VERB_MASK) != QBMAN_WQ_QUERY);
-- 
2.47.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-11-27 17:17:40.826716172 +0000
+++ 0081-bus-fslmc-fix-Coverity-warnings-in-QBMAN.patch	2024-11-27 17:17:38.283269674 +0000
@@ -1 +1 @@
-From 051f4185f98faa964b6a965b2e8e7b2da68969de Mon Sep 17 00:00:00 2001
+From e00b805528a35aeaa44dab06b793facfb8fca7d3 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 051f4185f98faa964b6a965b2e8e7b2da68969de ]
+
@@ -9 +10,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list