[v2] net/ice: fix null pointer dereferences

Message ID 20240304053751.567348-1-wenwux.ma@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers
Series [v2] net/ice: fix null pointer dereferences |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Ma, WenwuX March 4, 2024, 5:37 a.m. UTC
  This patch fixes two null pointer dereferences detected by
coverity scan.

Coverity issue: 414096
Fixes: 6ccef90ff5d3 ("net/ice: support VSI level bandwidth config")
Cc: stable@dpdk.org

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
v2:
 - deleting rather than modifying the prints that
   cause null pointer dereferences

---
 drivers/net/ice/ice_tm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
  

Comments

Bruce Richardson March 4, 2024, 10 a.m. UTC | #1
On Mon, Mar 04, 2024 at 01:37:51PM +0800, Wenwu Ma wrote:
> This patch fixes two null pointer dereferences detected by
> coverity scan.
> 
> Coverity issue: 414096
> Fixes: 6ccef90ff5d3 ("net/ice: support VSI level bandwidth config")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>

Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-net-intel with expanded commit log message.

thanks,
/Bruce
  

Patch

diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c
index fbab0b8808..17f0ca0ce0 100644
--- a/drivers/net/ice/ice_tm.c
+++ b/drivers/net/ice/ice_tm.c
@@ -615,10 +615,8 @@  static int ice_set_node_rate(struct ice_hw *hw,
 					   sched_node,
 					   ICE_MAX_BW,
 					   rate);
-	if (status) {
-		PMD_DRV_LOG(ERR, "Failed to set max bandwidth for node %u", tm_node->id);
+	if (status)
 		return -EINVAL;
-	}
 
 	if (reset || committed == 0)
 		rate = ICE_SCHED_DFLT_BW;
@@ -629,10 +627,8 @@  static int ice_set_node_rate(struct ice_hw *hw,
 					   sched_node,
 					   ICE_MIN_BW,
 					   rate);
-	if (status) {
-		PMD_DRV_LOG(ERR, "Failed to set min bandwidth for node %u", tm_node->id);
+	if (status)
 		return -EINVAL;
-	}
 
 	return 0;
 }