diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-06-05 02:42:56 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-05 10:20:33 -0400 |
commit | 47a6ca3f972f5baf06cd0c9f37d7b5268ade5363 (patch) | |
tree | e5702f968a95306f8519e89cc168308507fdce62 /drivers | |
parent | 6f6027a52bfbb9bbf18937d2628eaf1137a5a386 (diff) | |
download | linux-stable-47a6ca3f972f5baf06cd0c9f37d7b5268ade5363.tar.gz linux-stable-47a6ca3f972f5baf06cd0c9f37d7b5268ade5363.tar.bz2 linux-stable-47a6ca3f972f5baf06cd0c9f37d7b5268ade5363.zip |
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: 069d11465a80 ("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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 333d4ed52b94..89c96a0f708e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -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) |