patch 'common/cnxk: fix null check' has been queued to stable release 24.11.2
Kevin Traynor
ktraynor at redhat.com
Thu Feb 13 10:59:25 CET 2025
Hi,
FYI, your patch has been queued to stable release 24.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/17/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://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/b0ebe586b2a6bca5b23ecf6709d5a3bdef962afa
Thanks.
Kevin
---
>From b0ebe586b2a6bca5b23ecf6709d5a3bdef962afa Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 5 Feb 2025 08:23:20 -0800
Subject: [PATCH] common/cnxk: fix null check
[ upstream commit 1bab0289c6a58c3847ffbde2718b73a9b988deca ]
The pointer mode is used then checked which is a bug reported
by PVS studio.
Fixes: bd2fd34ab86f ("common/cnxk: sync eth mode change command with firmware")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
drivers/common/cnxk/roc_bphy_cgx.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/common/cnxk/roc_bphy_cgx.c b/drivers/common/cnxk/roc_bphy_cgx.c
index 4f43605e10..6e5cfc7b1d 100644
--- a/drivers/common/cnxk/roc_bphy_cgx.c
+++ b/drivers/common/cnxk/roc_bphy_cgx.c
@@ -370,4 +370,10 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
uint64_t scr1, scr0;
+ if (!mode)
+ return -EINVAL;
+
+ if (!roc_cgx)
+ return -EINVAL;
+
if (roc_model_is_cn9k() &&
(mode->use_portm_idx || mode->portm_idx || mode->mode_group_idx)) {
@@ -375,13 +381,7 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
}
- if (!roc_cgx)
- return -EINVAL;
-
if (!roc_bphy_cgx_lmac_exists(roc_cgx, lmac))
return -ENODEV;
- if (!mode)
- return -EINVAL;
-
scr1 = FIELD_PREP(SCR1_ETH_CMD_ID, ETH_CMD_MODE_CHANGE) |
FIELD_PREP(SCR1_ETH_MODE_CHANGE_ARGS_SPEED, mode->speed) |
--
2.48.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-12 17:29:46.960243789 +0000
+++ 0118-common-cnxk-fix-null-check.patch 2025-02-12 17:29:34.660947779 +0000
@@ -1 +1 @@
-From 1bab0289c6a58c3847ffbde2718b73a9b988deca Mon Sep 17 00:00:00 2001
+From b0ebe586b2a6bca5b23ecf6709d5a3bdef962afa Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 1bab0289c6a58c3847ffbde2718b73a9b988deca ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +19 @@
-index 882cf65474..db70bafd9b 100644
+index 4f43605e10..6e5cfc7b1d 100644
@@ -21 +22 @@
-@@ -367,4 +367,10 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
+@@ -370,4 +370,10 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
@@ -32 +33 @@
-@@ -372,13 +378,7 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
+@@ -375,13 +381,7 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
More information about the stable
mailing list