aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAviad Yehezkel <aviadye@mellanox.com>2012-09-05 18:50:51 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-07 12:55:59 -0400
commitbef772eb06051f49e84c3168f189b65074f19c3d (patch)
tree0144a999e3046efd0975442dd8fa99fdee3610ec /drivers/net
parent60d31c1475f20b6966f7efbd646b1123d0fba5b1 (diff)
net/mlx4_core: Fixing error flow in case of QUERY_FW failure
The order of operations was wrong on the teardown flow. Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 827b72dfce99..0fadac546b00 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -1234,13 +1234,13 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1234 mlx4_info(dev, "non-primary physical function, skipping.\n"); 1234 mlx4_info(dev, "non-primary physical function, skipping.\n");
1235 else 1235 else
1236 mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); 1236 mlx4_err(dev, "QUERY_FW command failed, aborting.\n");
1237 goto unmap_bf; 1237 return err;
1238 } 1238 }
1239 1239
1240 err = mlx4_load_fw(dev); 1240 err = mlx4_load_fw(dev);
1241 if (err) { 1241 if (err) {
1242 mlx4_err(dev, "Failed to start FW, aborting.\n"); 1242 mlx4_err(dev, "Failed to start FW, aborting.\n");
1243 goto unmap_bf; 1243 return err;
1244 } 1244 }
1245 1245
1246 mlx4_cfg.log_pg_sz_m = 1; 1246 mlx4_cfg.log_pg_sz_m = 1;
@@ -1304,7 +1304,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1304 err = mlx4_init_slave(dev); 1304 err = mlx4_init_slave(dev);
1305 if (err) { 1305 if (err) {
1306 mlx4_err(dev, "Failed to initialize slave\n"); 1306 mlx4_err(dev, "Failed to initialize slave\n");
1307 goto unmap_bf; 1307 return err;
1308 } 1308 }
1309 1309
1310 err = mlx4_slave_cap(dev); 1310 err = mlx4_slave_cap(dev);
@@ -1324,7 +1324,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1324 err = mlx4_QUERY_ADAPTER(dev, &adapter); 1324 err = mlx4_QUERY_ADAPTER(dev, &adapter);
1325 if (err) { 1325 if (err) {
1326 mlx4_err(dev, "QUERY_ADAPTER command failed, aborting.\n"); 1326 mlx4_err(dev, "QUERY_ADAPTER command failed, aborting.\n");
1327 goto err_close; 1327 goto unmap_bf;
1328 } 1328 }
1329 1329
1330 priv->eq_table.inta_pin = adapter.inta_pin; 1330 priv->eq_table.inta_pin = adapter.inta_pin;
@@ -1332,6 +1332,9 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
1332 1332
1333 return 0; 1333 return 0;
1334 1334
1335unmap_bf:
1336 unmap_bf_area(dev);
1337
1335err_close: 1338err_close:
1336 mlx4_close_hca(dev); 1339 mlx4_close_hca(dev);
1337 1340
@@ -1344,8 +1347,6 @@ err_stop_fw:
1344 mlx4_UNMAP_FA(dev); 1347 mlx4_UNMAP_FA(dev);
1345 mlx4_free_icm(dev, priv->fw.fw_icm, 0); 1348 mlx4_free_icm(dev, priv->fw.fw_icm, 0);
1346 } 1349 }
1347unmap_bf:
1348 unmap_bf_area(dev);
1349 return err; 1350 return err;
1350} 1351}
1351 1352