]> git.baikalelectronics.ru Git - kernel.git/commit
ice: fix potential infinite loop
authorColin Ian King <colin.king@canonical.com>
Fri, 2 Aug 2019 15:52:17 +0000 (16:52 +0100)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 27 Aug 2019 06:30:26 +0000 (23:30 -0700)
commit0b9c42d1750d9bb2b84e7d137a49cd1e724f103c
tree5f19a465fd60c7f511a0ba739d4bd202331307d9
parent8c6f00912d5cd83995344ae78b7457d02a1bacaa
ice: fix potential infinite loop

The loop counter of a for-loop is a u8 however this is being compared
to an int upper bound and this can lead to an infinite loop if the
upper bound is greater than 255 since the loop counter will wrap back
to zero. Fix this potential issue by making the loop counter an int.

Addresses-Coverity: ("Infinite loop")
Fixes: 4445c9dd7fa6 ("ice: Disable VFs until reset is completed")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c