summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox
diff options
context:
space:
mode:
authorDotan Barak <dotanb@dev.mellanox.co.il>2012-10-21 16:59:23 +0200
committerRoland Dreier <roland@purestorage.com>2012-10-23 18:03:37 +0200
commit41929ed2656bab8af1734bf5d0088385e72e294f (patch)
tree014c8f50383a1ccffdfb1d387aa1666727304252 /drivers/net/ethernet/mellanox
parentmlx4_core: Remove annoying debug messages from SR-IOV flow (diff)
downloadlinux-41929ed2656bab8af1734bf5d0088385e72e294f.tar.xz
linux-41929ed2656bab8af1734bf5d0088385e72e294f.zip
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 <dotanb@dev.mellanox.co.il> Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 80df2ab0177c..2aa80afd98d2 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -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))