Skip to contentSkip to conversation

net/mlx5_core: fix an error code

PATCH Applied Dan Carpenter 3 participants 3 messages Jun 11, 2015

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5_core: fix an error code

We return success if mlx5e_alloc_sq_db() fails but we should return an error code.

Fixes f62b8bb8f2d3 ('net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality')
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +2 -1
index 7348c51..075e517 100644
@@ -525,7 +525,8 @@ static int mlx5e_create_sq(struct mlx5e_channel *c,
 	sq->uar_map     = sq->uar.map;
 	sq->bf_buf_size = (1 << MLX5_CAP_GEN(mdev, log_bf_reg_size)) / 2;
 
-	if (mlx5e_alloc_sq_db(sq, cpu_to_node(c->cpu)))
+	err = mlx5e_alloc_sq_db(sq, cpu_to_node(c->cpu));
+	if (err)
 		goto err_sq_wq_destroy;
 
 	sq->txq = netdev_get_tx_queue(priv->netdev,
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dan Carpenter

We return success if mlx5e_alloc_sq_db() fails but we should return an error code.

Fixes f62b8bb8f2d3 ('net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality')
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -0
index 7348c51..075e517 100644

drivers/net/ethernet/mellanox/mlx5/core/en_main.c static int mlx5e_create_sq(struct mlx5e_channel *c, · line 532

Quoted 9 lines
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +2 -1
@@ -525,7 +525,8 @@ static int mlx5e_create_sq(struct mlx5e_channel *c,
        sq->uar_map     = sq->uar.map;
        sq->bf_buf_size = (1 << MLX5_CAP_GEN(mdev, log_bf_reg_size)) / 2;
 
-       if (mlx5e_alloc_sq_db(sq, cpu_to_node(c->cpu)))
+       err = mlx5e_alloc_sq_db(sq, cpu_to_node(c->cpu));
+       if (err)
                goto err_sq_wq_destroy;
 
        sq->txq = netdev_get_tx_queue(priv->netdev,

Dan, nice catch, the team here just handed me the same fix, but you submitted 1st...