patch 'common/cnxk: add missing checks of return values' has been queued to stable release 21.11.1

Kevin Traynor ktraynor at redhat.com
Tue Mar 1 11:42:08 CET 2022


Hi,

FYI, your patch has been queued to stable release 21.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/06/22. 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/7eeb8d37ed5884fce3d62c9fd7459b1ceb503f58

Thanks.

Kevin

---
>From 7eeb8d37ed5884fce3d62c9fd7459b1ceb503f58 Mon Sep 17 00:00:00 2001
From: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Date: Sat, 12 Feb 2022 18:08:18 +0530
Subject: [PATCH] common/cnxk: add missing checks of return values

[ upstream commit 14f7e5d4bf2d2c90c715b7d1cf1a973829289499 ]

This patch fixes coverity issue by adding checks on return values.

Coverity issue: 373628, 374858, 370213, 370215
Fixes: af75aac78978 ("common/cnxk: support telemetry for NIX")
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Fixes: fcdef46b6698 ("common/cnxk: support NIX TM debug and misc utils")
Fixes: df405df95eeb ("common/cnxk: add NIX TM helper to alloc/free resource")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn at marvell.com>
Acked-by: Jerin Jacob <jerinj at marvell.com>
---
 drivers/common/cnxk/cnxk_telemetry_nix.c | 3 +++
 drivers/common/cnxk/roc_irq.c            | 5 ++++-
 drivers/common/cnxk/roc_nix_debug.c      | 4 +++-
 drivers/common/cnxk/roc_nix_tm.c         | 6 ++++--
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/common/cnxk/cnxk_telemetry_nix.c b/drivers/common/cnxk/cnxk_telemetry_nix.c
index df6458039d..4119e9ee4f 100644
--- a/drivers/common/cnxk/cnxk_telemetry_nix.c
+++ b/drivers/common/cnxk/cnxk_telemetry_nix.c
@@ -766,4 +766,7 @@ cnxk_nix_tel_handle_info_x(const char *cmd, const char *params,
 	plt_strlcpy(buf, params, PCI_PRI_STR_SIZE + 1);
 	name = strtok(buf, ",");
+	if (name == NULL)
+		goto exit;
+
 	param = strtok(NULL, "\0");
 
diff --git a/drivers/common/cnxk/roc_irq.c b/drivers/common/cnxk/roc_irq.c
index 7a24297d72..010b121176 100644
--- a/drivers/common/cnxk/roc_irq.c
+++ b/drivers/common/cnxk/roc_irq.c
@@ -161,5 +161,8 @@ dev_irq_register(struct plt_intr_handle *intr_handle, plt_intr_callback_fn cb,
 	}
 
-	plt_intr_efds_index_set(intr_handle, vec, fd);
+	rc = plt_intr_efds_index_set(intr_handle, vec, fd);
+	if (rc)
+		return rc;
+
 	nb_efd = (vec > (uint32_t)plt_intr_nb_efd_get(intr_handle)) ?
 		vec : (uint32_t)plt_intr_nb_efd_get(intr_handle);
diff --git a/drivers/common/cnxk/roc_nix_debug.c b/drivers/common/cnxk/roc_nix_debug.c
index 7dc54f3845..9829c13b69 100644
--- a/drivers/common/cnxk/roc_nix_debug.c
+++ b/drivers/common/cnxk/roc_nix_debug.c
@@ -53,5 +53,7 @@ nix_bitmap_dump(struct plt_bitmap *bmp)
 
 	plt_bitmap_scan_init(bmp);
-	plt_bitmap_scan(bmp, &pos, &slab);
+	if (!plt_bitmap_scan(bmp, &pos, &slab))
+		return;
+
 	start_pos = pos;
 
diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c
index ebb27a3106..e765fe703c 100644
--- a/drivers/common/cnxk/roc_nix_tm.c
+++ b/drivers/common/cnxk/roc_nix_tm.c
@@ -1017,6 +1017,8 @@ nix_tm_assign_hw_id(struct nix *nix, struct nix_tm_node *parent,
 		}
 
-		if (!slab)
-			plt_bitmap_scan(bmp, &pos, &slab);
+		if (!slab) {
+			if (!plt_bitmap_scan(bmp, &pos, &slab))
+				return -ENOENT;
+		}
 
 		if (child->priority == parent->rr_prio && spare_schq != -1) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-03-01 10:41:02.803239831 +0000
+++ 0052-common-cnxk-add-missing-checks-of-return-values.patch	2022-03-01 10:41:01.337244105 +0000
@@ -1 +1 @@
-From 14f7e5d4bf2d2c90c715b7d1cf1a973829289499 Mon Sep 17 00:00:00 2001
+From 7eeb8d37ed5884fce3d62c9fd7459b1ceb503f58 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 14f7e5d4bf2d2c90c715b7d1cf1a973829289499 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -51 +52 @@
-index d5143882f5..1ae045172e 100644
+index 7dc54f3845..9829c13b69 100644
@@ -64 +65 @@
-index a0448bec61..517502b1af 100644
+index ebb27a3106..e765fe703c 100644



More information about the stable mailing list