DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice: fix null pointer dereferences
@ 2024-03-01  5:20 Wenwu Ma
  2024-03-01 10:34 ` Bruce Richardson
  2024-03-04  5:37 ` [PATCH v2] " Wenwu Ma
  0 siblings, 2 replies; 5+ messages in thread
From: Wenwu Ma @ 2024-03-01  5:20 UTC (permalink / raw)
  To: dev; +Cc: songx.jiale, Wenwu Ma

This patch fixes two null pointer dereferences detected by
coverity scan.

Coverity issue: 414096
Fixes: 6ccef90ff5d3 ("net/ice: support VSI level bandwidth config")

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
---
 drivers/net/ice/ice_tm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/ice_tm.c b/drivers/net/ice/ice_tm.c
index fbab0b8808..e10ac855f9 100644
--- a/drivers/net/ice/ice_tm.c
+++ b/drivers/net/ice/ice_tm.c
@@ -616,7 +616,10 @@ static int ice_set_node_rate(struct ice_hw *hw,
 					   ICE_MAX_BW,
 					   rate);
 	if (status) {
-		PMD_DRV_LOG(ERR, "Failed to set max bandwidth for node %u", tm_node->id);
+		if (tm_node != NULL)
+			PMD_DRV_LOG(ERR, "Failed to set max bandwidth for node %u", tm_node->id);
+		else
+			PMD_DRV_LOG(ERR, "Failed to set max bandwidth");
 		return -EINVAL;
 	}
 
@@ -630,7 +633,10 @@ static int ice_set_node_rate(struct ice_hw *hw,
 					   ICE_MIN_BW,
 					   rate);
 	if (status) {
-		PMD_DRV_LOG(ERR, "Failed to set min bandwidth for node %u", tm_node->id);
+		if (tm_node != NULL)
+			PMD_DRV_LOG(ERR, "Failed to set min bandwidth for node %u", tm_node->id);
+		else
+			PMD_DRV_LOG(ERR, "Failed to set min bandwidth");
 		return -EINVAL;
 	}
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-04 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01  5:20 [PATCH] net/ice: fix null pointer dereferences Wenwu Ma
2024-03-01 10:34 ` Bruce Richardson
2024-03-04  1:43   ` Ma, WenwuX
2024-03-04  5:37 ` [PATCH v2] " Wenwu Ma
2024-03-04 10:00   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).