mirror of https://gitee.com/openkylin/linux.git
i40iw: Fix potential fcn_id_array out of bounds
Avoid out of bounds error by utilizing I40IW_MAX_STATS_COUNT instead of I40IW_INVALID_FCN_ID. Signed-off-by: Christopher N Bednarz <christoper.n.bednarz@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
a28f047e5f
commit
aa939c12ab
|
@ -4881,7 +4881,7 @@ void i40iw_vsi_stats_free(struct i40iw_sc_vsi *vsi)
|
|||
{
|
||||
u8 fcn_id = vsi->fcn_id;
|
||||
|
||||
if ((vsi->stats_fcn_id_alloc) && (fcn_id != I40IW_INVALID_FCN_ID))
|
||||
if (vsi->stats_fcn_id_alloc && fcn_id < I40IW_MAX_STATS_COUNT)
|
||||
vsi->dev->fcn_id_array[fcn_id] = false;
|
||||
i40iw_hw_stats_stop_timer(vsi);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue