net/mlx5: SF, Fix error return code in mlx5_sf_dev_probe()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 10 Feb 2021 07:54:17 +0000 (07:54 +0000)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 11 Feb 2021 04:47:15 +0000 (20:47 -0800)
Fix to return negative error code -ENOMEM from the ioremap() error
handling case instead of 0, as done elsewhere in this function.

Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c

index daf63a8115e07025a2ef9e8c796726dc66a87ba5..c4bf555c25eaa56fc8c3eac9d604b30599d88583 100644 (file)
@@ -37,6 +37,7 @@ static int mlx5_sf_dev_probe(struct auxiliary_device *adev, const struct auxilia
        mdev->iseg = ioremap(mdev->iseg_base, sizeof(*mdev->iseg));
        if (!mdev->iseg) {
                mlx5_core_warn(mdev, "remap error\n");
+               err = -ENOMEM;
                goto remap_err;
        }