Thread (29 messages) read the whole thread 29 messages, 5 authors, 2023-10-24

Re: [PATCH net-next v3 08/11] net/mlx5: devlink health: use retained error fmsg API

From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Date: 2023-10-24 13:43:46
Also in: lkml

On 10/24/23 11:50, Dan Carpenter wrote:
On Wed, Oct 18, 2023 at 10:26:44PM +0200, Przemek Kitszel wrote:
quoted
  	if (rq->icosq) {
  		struct mlx5e_icosq *icosq = rq->icosq;
  		u8 icosq_hw_state;
  
-		err = mlx5_core_query_sq_state(rq->mdev, icosq->sqn, &icosq_hw_state);
-		if (err)
-			return err;
-
-		err = mlx5e_reporter_icosq_diagnose(icosq, icosq_hw_state, fmsg);
-		if (err)
-			return err;
+		mlx5_core_query_sq_state(rq->mdev, icosq->sqn, &icosq_hw_state);
When we remove the error checking then Smatch correctly complains that
icosq_hw_state is used uninitialized.

     drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c:268 mlx5e_rx_reporter_build_diagnose_output_rq_common()
     error: uninitialized symbol 'icosq_hw_state'.
quoted
+		mlx5e_reporter_icosq_diagnose(icosq, icosq_hw_state, fmsg);
  	}
  
  	return 0;
  }
See also:
     drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c:229 mlx5e_tx_reporter_build_diagnose_output_sq_common()
     error: uninitialized symbol 'state'.

regards,
dan carpenter
thank you for the report, I will post a fix soon
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help