patch 'common/cnxk: fix null check' has been queued to stable release 23.11.4
Xueming Li
xuemingl at nvidia.com
Tue Feb 18 13:35:21 CET 2025
Hi,
FYI, your patch has been queued to stable release 23.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
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=b1f0f150ca2f9fc29c9a6f1607fb432deb320869
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From b1f0f150ca2f9fc29c9a6f1607fb432deb320869 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-18 19:39:03.674812223 +0800
+++ 0086-common-cnxk-fix-null-check.patch 2025-02-18 19:39:00.738244029 +0800
@@ -1 +1 @@
-From 1bab0289c6a58c3847ffbde2718b73a9b988deca Mon Sep 17 00:00:00 2001
+From b1f0f150ca2f9fc29c9a6f1607fb432deb320869 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 1bab0289c6a58c3847ffbde2718b73a9b988deca ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -18 +20 @@
-index 882cf65474..db70bafd9b 100644
+index e966494e21..3d674dbe84 100644
@@ -21 +23 @@
-@@ -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