]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: Make sure that negative array index isn't used
authorDotan Barak <dotanb@dev.mellanox.co.il>
Wed, 16 Jul 2014 08:57:48 +0000 (11:57 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Jul 2014 06:26:24 +0000 (23:26 -0700)
commitc9d21da793f3d966db6262d235e10ad5ac96b8fa
tree6d467bc93c9ab39394242af2b1fe79c308125b50
parent43b94f097597481459d6e4398e32d4d9ee59adda
net/mlx4_core: Make sure that negative array index isn't used

To make sure that the array index isn't used in the code with
negative value, we stop using the for loop integer iterator
outside of it.
>From now on use members count to swap the last QP with removed one.
Fix also the second occurrence of this flow in mlx4_qp_detach_common().
In mlx4_qp_detach_common() use members_count instead of
loop iterator outside of the for loop.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/mcg.c