Skip to content

Commit b4f7726

Browse files
Eli CohenRoland Dreier
authored andcommitted
mlx4_core: Fix cleanup in __mlx4_init_one() error path
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>
1 parent 2b94607 commit b4f7726

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/net/mlx4/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
11741174
return 0;
11751175

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

11801180
mlx4_cleanup_mcg_table(dev);

0 commit comments

Comments
 (0)