]> git.baikalelectronics.ru Git - kernel.git/commit
igc: Check if num of q_vectors is smaller than max before array access
authorSasha Neftin <sasha.neftin@intel.com>
Mon, 14 Jun 2021 12:19:39 +0000 (15:19 +0300)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 20 Jul 2021 23:11:36 +0000 (16:11 -0700)
commite211ef494106298344ec5e60678df9fa2d36f019
treedc8c66ebe0ba63d7f65eb3662b348f505fbe81f1
parent036cbd82bb6debdff647cea218f2363519c5f8d8
igc: Check if num of q_vectors is smaller than max before array access

Ensure that the adapter->q_vector[MAX_Q_VECTORS] array isn't accessed
beyond its size. It was fixed by using a local variable num_q_vectors
as a limit for loop index, and ensure that num_q_vectors is not bigger
than MAX_Q_VECTORS.

Suggested-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Tested-by: Dvora Fuxbrumer <dvorax.fuxbrumer@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igc/igc_main.c