Skip to content

Commit b58515b

Browse files
Ingo Molnardavem330
authored andcommitted
mlx4: fix error path in drivers/net/mlx4/en_rx.c
this warning: drivers/net/mlx4/en_rx.c: In function ‘mlx4_en_activate_rx_rings’: drivers/net/mlx4/en_rx.c:412: warning: ‘err’ may be used uninitialized in this function Triggers because 'err' is uninitialized in the following input conditions: priv->rx_ring_num is zero and mlx4_en_fill_rx_buffers() fails. But even if ->rx_ring_num is nonzero, 'err' will be zero if mlx4_en_fill_rx_buffers() fails and mlx4_en_activate_rx_rings() returns success - incorrectly. So it's best to keep the error code uptodate on mlx4_en_fill_rx_buffers() calls as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4174439 commit b58515b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/net/mlx4/en_rx.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
443443
/* Fill Rx buffers */
444444
ring->full = 0;
445445
}
446-
if (mlx4_en_fill_rx_buffers(priv))
446+
err = mlx4_en_fill_rx_buffers(priv);
447+
if (err)
447448
goto err_buffers;
448449

449450
for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) {

0 commit comments

Comments
 (0)