DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenwu Ma <wenwux.ma@intel.com>
To: dev@dpdk.org
Cc: songx.jiale@intel.com, Wenwu Ma <wenwux.ma@intel.com>, stable@dpdk.org
Subject: [PATCH v2] net/ice: fix null pointer dereferences
Date: Mon,  4 Mar 2024 13:37:51 +0800	[thread overview]
Message-ID: <20240304053751.567348-1-wenwux.ma@intel.com> (raw)
In-Reply-To: <20240301052029.543989-1-wenwux.ma@intel.com>

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(-)

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;
 }
-- 
2.25.1


  parent reply	other threads:[~2024-03-04  5:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01  5:20 [PATCH] " Wenwu Ma
2024-03-01 10:34 ` Bruce Richardson
2024-03-04  1:43   ` Ma, WenwuX
2024-03-04  5:37 ` Wenwu Ma [this message]
2024-03-04 10:00   ` [PATCH v2] " Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240304053751.567348-1-wenwux.ma@intel.com \
    --to=wenwux.ma@intel.com \
    --cc=dev@dpdk.org \
    --cc=songx.jiale@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).