patch 'common/cnxk: fix null pointer checks' has been queued to stable release 23.11.5

Xueming Li xuemingl at nvidia.com
Wed Jul 30 09:10:15 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/10/25. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=fe309fb57e18d44550b4d198e3f7bb2e23cb72d0

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From fe309fb57e18d44550b4d198e3f7bb2e23cb72d0 Mon Sep 17 00:00:00 2001
From: Rahul Bhansali <rbhansali at marvell.com>
Date: Mon, 23 Jun 2025 10:19:07 +0530
Subject: [PATCH] common/cnxk: fix null pointer checks
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit bba99bb88c4f2bf3391ade016d808b27a8a17a19 ]

Adds null pointer check before executing CPT instruction.

Fixes: 4d00b8c6a331 ("common/cnxk: allocate dynamic BPIDs")
Fixes: 4af4e36a93d7 ("common/cnxk: support inline device API without ROC NIX")

Signed-off-by: Rahul Bhansali <rbhansali at marvell.com>
---
 drivers/common/cnxk/roc_nix_inl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/common/cnxk/roc_nix_inl.c b/drivers/common/cnxk/roc_nix_inl.c
index ba51ddd8c8..80379aa22b 100644
--- a/drivers/common/cnxk/roc_nix_inl.c
+++ b/drivers/common/cnxk/roc_nix_inl.c
@@ -813,7 +813,7 @@ int
 roc_nix_inl_inb_init(struct roc_nix *roc_nix)
 {
 	struct nix *nix = roc_nix_to_nix_priv(roc_nix);
-	struct roc_cpt_inline_ipsec_inb_cfg cfg;
+	struct roc_cpt_inline_ipsec_inb_cfg cfg = {0};
 	struct idev_cfg *idev = idev_get_cfg();
 	struct nix_inl_dev *inl_dev;
 	uint16_t bpids[ROC_NIX_MAX_BPID_CNT];
@@ -1619,7 +1619,7 @@ roc_nix_inl_sa_sync(struct roc_nix *roc_nix, void *sa, bool inb,
 	if (idev)
 		inl_dev = idev->nix_inl_dev;
 
-	if (!inl_dev && roc_nix == NULL)
+	if ((!inl_dev && roc_nix == NULL) || sa == NULL)
 		return -EINVAL;
 
 	if (roc_nix) {
@@ -1683,7 +1683,7 @@ roc_nix_inl_ctx_write(struct roc_nix *roc_nix, void *sa_dptr, void *sa_cptr,
 	if (idev)
 		inl_dev = idev->nix_inl_dev;
 
-	if (!inl_dev && roc_nix == NULL)
+	if ((!inl_dev && roc_nix == NULL) || sa_dptr == NULL || sa_cptr == NULL)
 		return -EINVAL;
 
 	if (roc_nix) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-30 15:02:12.974582847 +0800
+++ 0004-common-cnxk-fix-null-pointer-checks.patch	2025-07-30 15:02:12.771184135 +0800
@@ -1 +1 @@
-From bba99bb88c4f2bf3391ade016d808b27a8a17a19 Mon Sep 17 00:00:00 2001
+From fe309fb57e18d44550b4d198e3f7bb2e23cb72d0 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit bba99bb88c4f2bf3391ade016d808b27a8a17a19 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -18 +20 @@
-index bee8e25c7c..c7637ddbdc 100644
+index ba51ddd8c8..80379aa22b 100644
@@ -21,2 +23,2 @@
-@@ -1312,7 +1312,7 @@ static int
- nix_inl_legacy_inb_init(struct roc_nix *roc_nix)
+@@ -813,7 +813,7 @@ int
+ roc_nix_inl_inb_init(struct roc_nix *roc_nix)
@@ -27,0 +30 @@
+ 	struct nix_inl_dev *inl_dev;
@@ -29,2 +32 @@
- 	struct roc_cpt *roc_cpt;
-@@ -2219,7 +2219,7 @@ roc_nix_inl_sa_sync(struct roc_nix *roc_nix, void *sa, bool inb,
+@@ -1619,7 +1619,7 @@ roc_nix_inl_sa_sync(struct roc_nix *roc_nix, void *sa, bool inb,
@@ -39 +41 @@
-@@ -2299,7 +2299,7 @@ roc_nix_inl_ctx_write(struct roc_nix *roc_nix, void *sa_dptr, void *sa_cptr,
+@@ -1683,7 +1683,7 @@ roc_nix_inl_ctx_write(struct roc_nix *roc_nix, void *sa_dptr, void *sa_cptr,


More information about the stable mailing list