Skip to content

Commit

Permalink
mlx4_core: Fix cleanup in __mlx4_init_one() error path
Browse files Browse the repository at this point in the history
If mlx4_init_port_info() fails, cleanup the initialized ports only.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Eli Cohen authored and Roland Dreier committed Jan 6, 2010
1 parent 2b94607 commit b4f7726
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
return 0;

err_port:
for (port = 1; port <= dev->caps.num_ports; port++)
for (--port; port >= 1; --port)
mlx4_cleanup_port_info(&priv->port[port]);

mlx4_cleanup_mcg_table(dev);
Expand Down

0 comments on commit b4f7726

Please sign in to comment.