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: Dotan Barak <[email protected]>
Reviewed-by: Jack Morgenstein <[email protected]>
Signed-off-by: Or Gerlitz <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
This commit is contained in:
Dotan Barak 2012-10-21 14:59:23 +00:00 • committed by Roland Dreier
commit 41929ed265

View file

@ -1405,7 +1405,10 @@ unmap_bf:
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))