Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f614fc15 authored by Dan Carpenter's avatar Dan Carpenter Committed by Roland Dreier
Browse files

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: 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>
parent bfa76d49
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -997,7 +997,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;