Skip to content

Commit

Permalink
i40iw: Fix potential fcn_id_array out of bounds
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christopher N Bednarz authored and Doug Ledford committed Aug 16, 2017
1 parent a28f047 commit aa939c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/i40iw/i40iw_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit aa939c1

Please sign in to comment.