The non-leaf node parameter validation rejects any non-NULL
wfq_weight_mode pointer because WFQ is not supported.

A later branch checks the same pointer again before dereferencing it.
This branch cannot be reached because every non-NULL pointer has
already caused the function to return.

Remove the unreachable check. This does not change the accepted input
or error handling.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 03a249b62bbd ("net/i40e: support adding TM node")
Cc: [email protected]
Signed-off-by: Artem Novikov <[email protected]>
---
 drivers/net/intel/i40e/i40e_tm.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/net/intel/i40e/i40e_tm.c b/drivers/net/intel/i40e/i40e_tm.c
index 6f7e8cc801..1d7355aa41 100644
--- a/drivers/net/intel/i40e/i40e_tm.c
+++ b/drivers/net/intel/i40e/i40e_tm.c
@@ -401,12 +401,6 @@ i40e_node_param_check(struct rte_eth_dev *dev, uint32_t 
node_id,
                                RTE_TM_ERROR_TYPE_NODE_PARAMS_N_SP_PRIORITIES;
                        error->message = "SP priority not supported";
                        return -EINVAL;
-               } else if (params->nonleaf.wfq_weight_mode &&
-                          !(*params->nonleaf.wfq_weight_mode)) {
-                       error->type =
-                               RTE_TM_ERROR_TYPE_NODE_PARAMS_WFQ_WEIGHT_MODE;
-                       error->message = "WFP should be byte mode";
-                       return -EINVAL;
                }
 
                return 0;
-- 
2.43.0


Reply via email to