i40e: Fix potential out of bound array access
authorSudheer Mogilappagari <sudheer.mogilappagari@intel.com>
Wed, 7 Jun 2017 09:43:05 +0000 (05:43 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 21 Jun 2017 01:17:10 +0000 (18:17 -0700)
commit1e99854715c79b3e2ebe09d80006aaff0f5c2335
treeb13bdf997f13df0f0f0722d8e55166652bab3740
parent15d23b4c361f1449d44249bea127d2bdb981aa01
i40e: Fix potential out of bound array access

This is a fix for the static code analysis issue where dcbcfg->numapps
could be greater than size of array (i.e dcbcfg->app[I40E_DCBX_MAX_APPS]).
The fix makes sure that the array is not accessed past the size of
of the array (i.e. I40E_DCBX_MAX_APPS).

Copyright updated to 2017.

Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@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_dcb.c