Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e0f03d5 authored by Yevgeny Petrilin's avatar Yevgeny Petrilin Committed by David S. Miller
Browse files

mlx4_core: Fixing array indexes when setting port types

parent e3e09f26
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -538,7 +538,7 @@ int mlx4_change_port_types(struct mlx4_dev *dev,
		mlx4_unregister_device(dev);
		mlx4_unregister_device(dev);
		for (port = 1; port <= dev->caps.num_ports; port++) {
		for (port = 1; port <= dev->caps.num_ports; port++) {
			mlx4_CLOSE_PORT(dev, 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);
			err = mlx4_SET_PORT(dev, port);
			if (err) {
			if (err) {
				mlx4_err(dev, "Failed to set port %d, "
				mlx4_err(dev, "Failed to set port %d, "