mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
i40e: fix idx validation in config queues msg
[ Upstream commit f1ad24c5abe1eaef69158bac1405a74b3c365115 ]
Ensure idx is within range of active/initialized TCs when iterating over
vf->ch[idx] in i40e_vc_config_queues_msg().
Fixes: c27eac4816 ("i40e: Enable ADq and create queue channel/s on VF")
Cc: stable@vger.kernel.org
Signed-off-by: Lukasz Czapnik <lukasz.czapnik@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Kamakshi Nellore <nellorex.kamakshi@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
[ Adjust context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0543d40d65
commit
a6ff2af783
1 changed files with 2 additions and 2 deletions
|
|
@ -2320,7 +2320,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
|
|||
}
|
||||
|
||||
if (vf->adq_enabled) {
|
||||
if (idx >= ARRAY_SIZE(vf->ch)) {
|
||||
if (idx >= vf->num_tc) {
|
||||
aq_ret = I40E_ERR_NO_AVAILABLE_VSI;
|
||||
goto error_param;
|
||||
}
|
||||
|
|
@ -2341,7 +2341,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
|
|||
* to its appropriate VSIs based on TC mapping
|
||||
*/
|
||||
if (vf->adq_enabled) {
|
||||
if (idx >= ARRAY_SIZE(vf->ch)) {
|
||||
if (idx >= vf->num_tc) {
|
||||
aq_ret = I40E_ERR_NO_AVAILABLE_VSI;
|
||||
goto error_param;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue