Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83de91f8 authored by Wei Yongjun's avatar Wei Yongjun Committed by Saeed Mahameed
Browse files

net/mlx5: DR, Fix error return code in dr_domain_init_resources()



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

Fixes: 4ec9e7b0 ("net/mlx5: DR, Expose steering domain functionality")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent f6a8cddf
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -66,6 +66,7 @@ static int dr_domain_init_resources(struct mlx5dr_domain *dmn)
	dmn->uar = mlx5_get_uars_page(dmn->mdev);
	dmn->uar = mlx5_get_uars_page(dmn->mdev);
	if (!dmn->uar) {
	if (!dmn->uar) {
		mlx5dr_err(dmn, "Couldn't allocate UAR\n");
		mlx5dr_err(dmn, "Couldn't allocate UAR\n");
		ret = -ENOMEM;
		goto clean_pd;
		goto clean_pd;
	}
	}


@@ -73,6 +74,7 @@ static int dr_domain_init_resources(struct mlx5dr_domain *dmn)
	if (!dmn->ste_icm_pool) {
	if (!dmn->ste_icm_pool) {
		mlx5dr_err(dmn, "Couldn't get icm memory for %s\n",
		mlx5dr_err(dmn, "Couldn't get icm memory for %s\n",
			   dev_name(dmn->mdev->device));
			   dev_name(dmn->mdev->device));
		ret = -ENOMEM;
		goto clean_uar;
		goto clean_uar;
	}
	}


@@ -80,6 +82,7 @@ static int dr_domain_init_resources(struct mlx5dr_domain *dmn)
	if (!dmn->action_icm_pool) {
	if (!dmn->action_icm_pool) {
		mlx5dr_err(dmn, "Couldn't get action icm memory for %s\n",
		mlx5dr_err(dmn, "Couldn't get action icm memory for %s\n",
			   dev_name(dmn->mdev->device));
			   dev_name(dmn->mdev->device));
		ret = -ENOMEM;
		goto free_ste_icm_pool;
		goto free_ste_icm_pool;
	}
	}