summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/i40iw/i40iw_ctrl.c
diff options
context:
space:
mode:
authorChristopher N Bednarz <christopher.n.bednarz@intel.com>2017-08-09 04:38:48 +0300
committerDoug Ledford <dledford@redhat.com>2017-08-16 18:27:44 +0300
commitaa939c12ab8a0c094420ad1b909a957ac590e43e (patch)
tree4d25488be5d3e1f41da77144adea0d379c0d8a6a /drivers/infiniband/hw/i40iw/i40iw_ctrl.c
parenta28f047e5f9b987d614eeee34388087ffdda3e53 (diff)
downloadlinux-aa939c12ab8a0c094420ad1b909a957ac590e43e.tar.xz
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>
Diffstat (limited to 'drivers/infiniband/hw/i40iw/i40iw_ctrl.c')
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_ctrl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c
index ef4a73cd1710..a49ff2eb6fb3 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c
@@ -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);
}