net/mlx5: DR, Fix error return code in dr_domain_init_resources()
authorWei Yongjun <weiyongjun1@huawei.com>
Thu, 5 Sep 2019 09:56:00 +0000 (09:56 +0000)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 5 Sep 2019 21:44:42 +0000 (14:44 -0700)
Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 4ec9e7b02697 ("net/mlx5: DR, Expose steering domain functionality")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c

index 3b9cf0bccf4db0b6fb3f11a582e3248e6575967d..461cc2c30538ef80b9c030feb0e651cb3ff3f132 100644 (file)
@@ -66,6 +66,7 @@ static int dr_domain_init_resources(struct mlx5dr_domain *dmn)
        dmn->uar = mlx5_get_uars_page(dmn->mdev);
        if (!dmn->uar) {
                mlx5dr_err(dmn, "Couldn't allocate UAR\n");
+               ret = -ENOMEM;
                goto clean_pd;
        }
 
@@ -73,6 +74,7 @@ static int dr_domain_init_resources(struct mlx5dr_domain *dmn)
        if (!dmn->ste_icm_pool) {
                mlx5dr_err(dmn, "Couldn't get icm memory for %s\n",
                           dev_name(dmn->mdev->device));
+               ret = -ENOMEM;
                goto clean_uar;
        }
 
@@ -80,6 +82,7 @@ static int dr_domain_init_resources(struct mlx5dr_domain *dmn)
        if (!dmn->action_icm_pool) {
                mlx5dr_err(dmn, "Couldn't get action icm memory for %s\n",
                           dev_name(dmn->mdev->device));
+               ret = -ENOMEM;
                goto free_ste_icm_pool;
        }