Skip to content

Commit f1ad24c

Browse files
lczapnikanguy11
authored andcommitted
i40e: fix idx validation in config queues msg
Ensure idx is within range of active/initialized TCs when iterating over vf->ch[idx] in i40e_vc_config_queues_msg(). Fixes: c27eac4 ("i40e: Enable ADq and create queue channel/s on VF") Cc: [email protected] Signed-off-by: Lukasz Czapnik <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Przemek Kitszel <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Kamakshi Nellore <[email protected]> (A Contingent Worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent aa68d3c commit f1ad24c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,7 +2395,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
23952395
}
23962396

23972397
if (vf->adq_enabled) {
2398-
if (idx >= ARRAY_SIZE(vf->ch)) {
2398+
if (idx >= vf->num_tc) {
23992399
aq_ret = -ENODEV;
24002400
goto error_param;
24012401
}
@@ -2416,7 +2416,7 @@ static int i40e_vc_config_queues_msg(struct i40e_vf *vf, u8 *msg)
24162416
* to its appropriate VSIs based on TC mapping
24172417
*/
24182418
if (vf->adq_enabled) {
2419-
if (idx >= ARRAY_SIZE(vf->ch)) {
2419+
if (idx >= vf->num_tc) {
24202420
aq_ret = -ENODEV;
24212421
goto error_param;
24222422
}

0 commit comments

Comments
 (0)