Skip to contentSkip to conversation

mlx4_core: Cleanup bug in __mlx4_init_one()

PATCH Superseded Eli Cohen 3 participants 3 messages Dec 9, 2009 1 message not in the archive

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Eli Cohen

author
#0 lore raw

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

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

---
 drivers/net/mlx4/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/mlx4/main.c +1 -1
index 6f5a3cf..0c868c9 100644
@@ -1294,7 +1294,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_counters_table(dev);
Signature · 1 line
1.6.5.5

A message that is not in the archive (sent off-list or not yet received): adatyvzpyhl.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org

#3 lore raw
Quoted 2 lines · Roland Dreier

Looks like a valid fix but your patch doesn't apply. I don't seem to have mlx4_cleanup_counters_table() in my tree.

I noticed that already. I'll send a new patch in my next working day.