IB/mlx5: Return appropriate error code instead of ENOMEM
authorParav Pandit <parav@nvidia.com>
Wed, 27 Jan 2021 15:00:07 +0000 (17:00 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 2 Feb 2021 17:21:18 +0000 (13:21 -0400)
When mlx5_ib_stage_init_init() fails, return the error code related to
failure instead of -ENOMEM.

Fixes: 16c1975f1032 ("IB/mlx5: Create profile infrastructure to add and remove stages")
Link: https://lore.kernel.org/r/20210127150010.1876121-8-leon@kernel.org
Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/main.c

index ecbb8443b0eced5a1dfe08eb06fa6fc57aa3c0f8..477c90bc5b0ea1161e286044feaec176dd76db8f 100644 (file)
@@ -3998,8 +3998,7 @@ static int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev)
 
 err_mp:
        mlx5_ib_cleanup_multiport_master(dev);
-
-       return -ENOMEM;
+       return err;
 }
 
 static int mlx5_ib_enable_driver(struct ib_device *dev)