patch 'common/cnxk: fix null check' has been queued to stable release 22.11.8
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Feb 17 18:04:49 CET 2025
Hi,
FYI, your patch has been queued to stable release 22.11.8
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/19/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0ac965dafc74a22d160f3183fe7aea7fe4ea2d11
Thanks.
Luca Boccassi
---
>From 0ac965dafc74a22d160f3183fe7aea7fe4ea2d11 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 e966494e21..3d674dbe84 100644
--- a/drivers/common/cnxk/roc_bphy_cgx.c
+++ b/drivers/common/cnxk/roc_bphy_cgx.c
@@ -364,20 +364,20 @@ 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)) {
return -ENOTSUP;
}
- 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) |
FIELD_PREP(SCR1_ETH_MODE_CHANGE_ARGS_DUPLEX, mode->full_duplex) |
--
2.47.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-17 16:13:19.497406114 +0000
+++ 0076-common-cnxk-fix-null-check.patch 2025-02-17 16:13:16.874441592 +0000
@@ -1 +1 @@
-From 1bab0289c6a58c3847ffbde2718b73a9b988deca Mon Sep 17 00:00:00 2001
+From 0ac965dafc74a22d160f3183fe7aea7fe4ea2d11 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 e966494e21..3d674dbe84 100644
@@ -21 +22 @@
-@@ -366,20 +366,20 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
+@@ -364,20 +364,20 @@ roc_bphy_cgx_set_link_mode(struct roc_bphy_cgx *roc_cgx, unsigned int lmac,
More information about the stable
mailing list