Commit 41929ed2 authored by Dotan Barak's avatar Dotan Barak Committed by Roland Dreier

mlx4_core: Perform correct resource cleanup if mlx4_QUERY_ADAPTER() fails

Fixed the resource cleanup to act correctly and prevent a kernel oops when
mlx4_QUERY_ADAPTER() fails.
Signed-off-by: default avatarDotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: default avatarJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 3cf164c8
......@@ -1405,7 +1405,10 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
unmap_bf_area(dev);
err_close:
mlx4_close_hca(dev);
if (mlx4_is_slave(dev))
mlx4_slave_exit(dev);
else
mlx4_CLOSE_HCA(dev, 0);
err_free_icm:
if (!mlx4_is_slave(dev))
......
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