From 4c777b4a1aedf944ca581024e5a77d189dfee265 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Wed, 7 Dec 2016 14:45:34 -0800 Subject: [PATCH] qcacmn: Fix incorrect data type assignment In function wma_get_buf_extscan_change_monitor_cmd() and wma_get_buf_iextscan_hotlist_cmd(), numAp is of type uint32_t but it is assigned to variable numap of type int. Fix this by making 'numap' also of same type 'uint32_t'. Change-Id: I02502f05d2305f62cbde47db2893770673d19fc3 CRs-Fixed: 1096384 --- wmi_unified_tlv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wmi_unified_tlv.c b/wmi_unified_tlv.c index e146900837..0bc5c526df 100644 --- a/wmi_unified_tlv.c +++ b/wmi_unified_tlv.c @@ -5564,10 +5564,10 @@ static QDF_STATUS wmi_get_buf_extscan_change_monitor_cmd(wmi_unified_t wmi_handl uint8_t *buf_ptr; int j; int len = sizeof(*cmd); - int numap = psigchange->num_ap; + uint32_t numap = psigchange->num_ap; struct ap_threshold_params *src_ap = psigchange->ap; - if (!numap) { + if (!numap || (numap > WMI_WLAN_EXTSCAN_MAX_SIGNIFICANT_CHANGE_APS)) { WMI_LOGE("%s: Invalid number of bssid's", __func__); return QDF_STATUS_E_INVAL; } @@ -11279,7 +11279,7 @@ QDF_STATUS send_get_buf_extscan_hotlist_cmd_tlv(wmi_unified_t wmi_handle, int cmd_len = 0; int num_entries; int min_entries = 0; - int numap = photlist->numAp; + uint32_t numap = photlist->numAp; int len = sizeof(*cmd); len += WMI_TLV_HDR_SIZE; @@ -11291,7 +11291,7 @@ QDF_STATUS send_get_buf_extscan_hotlist_cmd_tlv(wmi_unified_t wmi_handle, /* setbssid hotlist expects the bssid list * to be non zero value */ - if ((numap <= 0) || (numap > WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS)) { + if (!numap || (numap > WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS)) { WMI_LOGE("Invalid number of APs: %d", numap); return QDF_STATUS_E_INVAL; }