Patchwork [net] mlx4_core: Fixing array indexes when setting port types

login
register
mail settings
Submitter Yevgeny Petrilin
Date Feb. 23, 2012, 5:04 p.m.
Message ID <4F4671A3.60600@mellanox.co.il>
Download mbox | patch
Permalink /patch/142675/
State Accepted
Delegated to: David Miller
Headers show

Comments

Yevgeny Petrilin - Feb. 23, 2012, 5:04 p.m.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
---
 drivers/net/ethernet/mellanox/mlx4/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
David Miller - Feb. 24, 2012, 6:53 a.m.
From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Date: Thu, 23 Feb 2012 19:04:35 +0200

> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 32f8799..d498f04 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -538,7 +538,7 @@  int mlx4_change_port_types(struct mlx4_dev *dev,
 		mlx4_unregister_device(dev);
 		for (port = 1; port <= dev->caps.num_ports; port++) {
 			mlx4_CLOSE_PORT(dev, port);
-			dev->caps.port_type[port + 1] = port_types[port];
+			dev->caps.port_type[port] = port_types[port - 1];
 			err = mlx4_SET_PORT(dev, port);
 			if (err) {
 				mlx4_err(dev, "Failed to set port %d, "