Skip to contentSkip to conversation

mlx4_core: Cleanup bug in __mlx4_init_one()

PATCH In review Eli Cohen 2 participants 2 messages Dec 10, 2009 – Jan 6, 2010

Subsystems (2)
lore
Share & tools
lore

Eli Cohen

author
#0 lore raw

PATCH v2 1/1 mlx4_core: Cleanup bug in __mlx4_init_one()

If mlx4_init_port_info() fails, cleanup the initialized ports only.

---
Changes: rebase the patch on Roland's for-next branch

 drivers/net/mlx4/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/mlx4/main.c +1 -1
index 291a505..3cf56d9 100644
@@ -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);
Signature · 6 lines
1.6.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html