aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Czapnik <[email protected]>2025-08-13 10:45:13 +0000
committerTony Nguyen <[email protected]>2025-09-18 22:46:29 +0000
commitf1ad24c5abe1eaef69158bac1405a74b3c365115 (patch)
tree0ea673db91cde5bfc085073f51f0df9bd753062a
parenti40e: fix idx validation in i40e_validate_queue_map (diff)
downloadkernel-f1ad24c5abe1eaef69158bac1405a74b3c365115.tar.gz
kernel-f1ad24c5abe1eaef69158bac1405a74b3c365115.zip
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: c27eac48160d ("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]>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 1c4f86221255..b6db4d78c02d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -2395,7 +2395,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 = -ENODEV;
goto error_param;
}
@@ -2416,7 +2416,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 = -ENODEV;
goto error_param;
}