diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-01-12 03:56:58 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2015-02-17 13:22:59 -0500 |
commit | f614fc15ae39ceb531586e3969f2b99fd23182a0 (patch) | |
tree | e16ee8b0bca811affd161434c0d3b19d34064f70 | |
parent | bfa76d49576599a4b9f9b7a71f23d73d6dcff735 (diff) |
IB/mlx5: Fix error code in get_port_caps()
The current code returns success when kmalloc() fails. It should
return an error code, -ENOMEM.
Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | drivers/infiniband/hw/mlx5/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 03bf81211a54..b1eda4a602a8 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
@@ -997,7 +997,7 @@ static int get_port_caps(struct mlx5_ib_dev *dev) | |||
997 | struct ib_device_attr *dprops = NULL; | 997 | struct ib_device_attr *dprops = NULL; |
998 | struct ib_port_attr *pprops = NULL; | 998 | struct ib_port_attr *pprops = NULL; |
999 | struct mlx5_general_caps *gen; | 999 | struct mlx5_general_caps *gen; |
1000 | int err = 0; | 1000 | int err = -ENOMEM; |
1001 | int port; | 1001 | int port; |
1002 | 1002 | ||
1003 | gen = &dev->mdev->caps.gen; | 1003 | gen = &dev->mdev->caps.gen; |