Skip to content

Commit

Permalink
net/mlx5e: fix error return code in mlx5e_alloc_rq()
Browse files Browse the repository at this point in the history
Fix to return error code -ENOMEM from the kvzalloc_node() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 069d114 ("net/mlx5e: RX, Enhance legacy Receive Queue memory scheme")
Signed-off-by: Wei Yongjun <[email protected]>
Reviewed-by: Tariq Toukan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Wei Yongjun authored and davem330 committed Jun 5, 2018
1 parent 6f6027a commit 47a6ca3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,10 @@ static int mlx5e_alloc_rq(struct mlx5e_channel *c,
kvzalloc_node((wq_sz << rq->wqe.info.log_num_frags) *
sizeof(*rq->wqe.frags),
GFP_KERNEL, cpu_to_node(c->cpu));
if (!rq->wqe.frags)
if (!rq->wqe.frags) {
err = -ENOMEM;
goto err_free;
}

err = mlx5e_init_di_list(rq, params, wq_sz, c->cpu);
if (err)
Expand Down

0 comments on commit 47a6ca3

Please sign in to comment.