提交 41929ed2 编写于 作者: D Dotan Barak 提交者: 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: NDotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册