aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-11-25 19:53:32 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 19:53:32 -0500
commitb58515be978f9377b9546ae98ad6c8bbc2f93ee1 (patch)
tree230f7d66aab199ca3e0feded8afe4b5e82b94ebd /drivers/net/mlx4
parent4174439ef5894964803c6300e7e88d97e075e4c0 (diff)
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>
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r--drivers/net/mlx4/en_rx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 944ad47c9519..ffe28089b687 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -443,7 +443,8 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
443 /* Fill Rx buffers */ 443 /* Fill Rx buffers */
444 ring->full = 0; 444 ring->full = 0;
445 } 445 }
446 if (mlx4_en_fill_rx_buffers(priv)) 446 err = mlx4_en_fill_rx_buffers(priv);
447 if (err)
447 goto err_buffers; 448 goto err_buffers;
448 449
449 for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) { 450 for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) {