1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-24 17:23:25 -05:00

net/mlx5e: fix error return code in mlx5e_alloc_rq()

Fix to return error code -ENOMEM from the kvzalloc_node() error handling
case instead of 0, as done elsewhere in this function.

Fixes: 069d11465a ("net/mlx5e: RX, Enhance legacy Receive Queue memory scheme")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Wei Yongjun 2018-06-05 02:42:56 +00:00 committed by David S. Miller
parent 6f6027a52b
commit 47a6ca3f97

View file

@ -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)