]> git.baikalelectronics.ru Git - kernel.git/commit
i40e: add check for return from find_first_bit call
authorLihong Yang <lihong.yang@intel.com>
Thu, 7 Sep 2017 12:05:54 +0000 (08:05 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 9 Oct 2017 21:30:41 +0000 (14:30 -0700)
commit26ed51a5975fa4f1b2c4d42dbe0f1d53aed4626c
treef64ff382da7c051baf779d8bc4cc5c985436b1de
parent111ff146641f6a92ea3a424bac177a7e77bc4ea2
i40e: add check for return from find_first_bit call

The find_first_bit function will return the size passed to search
if the first set bit is not found. This patch adds the check in case
that happens as the return value would be used as the index in an array
and that would have caused the out-of-bounds access.

Detected by CoverityScan, CID 1295969 Out-of-bounds access

Signed-off-by: Lihong Yang <lihong.yang@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c