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

Coverity issue: 414096
Fixes: 6ccef90ff5d3 ("net/ice: support VSI level bandwidth config")
Cc: [email protected]

Signed-off-by: Wenwu Ma <[email protected]>
---
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

Reply via email to