mlx4_core: Fixing array indexes when setting port types
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>
Thu, 23 Feb 2012 07:04:35 +0000 (07:04 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Feb 2012 06:52:45 +0000 (01:52 -0500)
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c

index 32f8799db190556572f919eddbaddb42d5ece5af..d498f049c74ecfa6578f02f1257e1063291bbe0d 100644 (file)
@@ -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, "