igb: 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. Fixes: 047e0030 ("igb: add new data structure for handling interrupts and NAPI") Signed-off-by: NAleksandr Loktionov <aleksandr.loktionov@intel.com> Reviewed-by: NGrzegorz Siwik <grzegorz.siwik@intel.com> Reviewed-by: NArkadiusz Kubalewski <arkadiusz.kubalewski@intel.com> Reviewed-by: NSlawomir Laba <slawomirx.laba@intel.com> Reviewed-by: NSylwester Dziedziuch <sylwesterx.dziedziuch@intel.com> Reviewed-by: NMateusz Palczewski <mateusz.placzewski@intel.com> Tested-by: NTony Brelinski <tonyx.brelinski@intel.com> Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
Showing
想要评论请 注册 或 登录