Skip to content

Commit

Permalink
IB/mlx5: Fix error code in get_port_caps()
Browse files Browse the repository at this point in the history
The current code returns success when kmalloc() fails.  It should
return an error code, -ENOMEM.

Fixes: e126ba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
  • Loading branch information
Dan Carpenter authored and rolandd committed Feb 17, 2015
1 parent bfa76d4 commit f614fc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f614fc1

Please sign in to comment.