qcacmn: Fix validation of stats_req_type in stats component

Use correct validation range.

Change-Id: I8ba12efee1f2ffac5a2193c7f9f5a5e44a1c8301
CRs-Fixed: 2326371
This commit is contained in:
Arif Hussain 2018-10-02 11:55:47 -07:00 • committed by nshrivas
commit b91687b07b

View file

@ -487,7 +487,7 @@ QDF_STATUS ucfg_mc_cp_stats_set_pending_req(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_NULL_VALUE;
}
if (type > TYPE_MAX) {
if (type >= TYPE_MAX) {
cp_stats_err("Invalid type index: %d", type);
return QDF_STATUS_E_INVAL;
}
@ -513,7 +513,7 @@ QDF_STATUS ucfg_mc_cp_stats_reset_pending_req(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_NULL_VALUE;
}
if (type > TYPE_MAX) {
if (type >= TYPE_MAX) {
cp_stats_err("Invalid type index: %d", type);
return QDF_STATUS_E_INVAL;
}
@ -541,7 +541,7 @@ QDF_STATUS ucfg_mc_cp_stats_get_pending_req(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_NULL_VALUE;
}
if (type > TYPE_MAX) {
if (type >= TYPE_MAX) {
cp_stats_err("Invalid type index: %d", type);
return QDF_STATUS_E_INVAL;
}