From: Eli Cohen Date: Wed, 6 Jan 2010 20:54:39 +0000 (-0800) Subject: mlx4_core: Fix cleanup in __mlx4_init_one() error path X-Git-Tag: 2.1b_release~9740^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4f77264cd1a858ee09da8dba5a2711a649adbf3;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git 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 Signed-off-by: Roland Dreier --- diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 291a505..3cf56d9 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c @@ -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);