Commit aeda89ac authored by Dan Carpenter's avatar Dan Carpenter Committed by Sasha Levin

IB/mlx5: Fix error code in get_port_caps()

commit f614fc15 upstream.

The current code returns success when kmalloc() fails.  It should
return an error code, -ENOMEM.

Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 78a1437c
......@@ -987,7 +987,7 @@ static int get_port_caps(struct mlx5_ib_dev *dev)
struct ib_device_attr *dprops = NULL;
struct ib_port_attr *pprops = NULL;
struct mlx5_general_caps *gen;
int err = 0;
int err = -ENOMEM;
int port;
gen = &dev->mdev->caps.gen;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment