diff options
author | Eran Ben Elisha <eranbe@mellanox.com> | 2017-11-20 10:58:01 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-01-12 03:01:47 +0300 |
commit | 72f36be06138bdc11bdbe1f04e4a3e2637ea438d (patch) | |
tree | ab975a43730639e212df98c5dccd97752c0de441 /drivers/net/ethernet/mellanox/mlx5/core/main.c | |
parent | b6908c296021a99ba2a83a4b4703eb9e6365e5dc (diff) | |
download | linux-72f36be06138bdc11bdbe1f04e4a3e2637ea438d.tar.xz |
net/mlx5: Fix mlx5_get_uars_page to return error code
Change mlx5_get_uars_page to return ERR_PTR in case of
allocation failure. Change all callers accordingly to
check the IS_ERR(ptr) instead of NULL.
Fixes: 59211bd3b632 ("net/mlx5: Split the load/unload flow into hardware and software flows")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/main.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index a4c82fa71aec..6dffa58fb178 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1135,8 +1135,9 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv, } dev->priv.uar = mlx5_get_uars_page(dev); - if (!dev->priv.uar) { + if (IS_ERR(dev->priv.uar)) { dev_err(&pdev->dev, "Failed allocating uar, aborting\n"); + err = PTR_ERR(dev->priv.uar); goto err_disable_msix; } |