summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Girigowda <sgirigow@qca.qualcomm.com>2014-03-24 17:59:29 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-03-25 17:24:40 -0700
commit6b0e0342012f3578096a608385f124272ac2ab2d (patch)
tree6d89c0a90f02c2a55b5beac3a1e15c77e88dbe14
parent520dbf1aa53bdae411db47f6a73f4ebd1e421bd2 (diff)
qcacld: Fix issues found by static code analysis
Fix the issues reported by static code analysis tool Change-Id: I70708a96cac69769523ef822b2c89bb627aa889c CRs-Fixed: 637767
-rw-r--r--CORE/HDD/src/wlan_hdd_cfg80211.c5
-rw-r--r--CORE/HDD/src/wlan_hdd_early_suspend.c5
-rw-r--r--CORE/SERVICES/WMA/wma.c3
3 files changed, 12 insertions, 1 deletions
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 3ac2ebbbb8d4..8d8afb994986 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -4428,6 +4428,11 @@ static struct cfg80211_bss* wlan_hdd_cfg80211_inform_bss(
chan = __ieee80211_get_channel(wiphy, freq);
+ if (!chan) {
+ hddLog(VOS_TRACE_LEVEL_ERROR, "%s chan pointer is NULL", __func__);
+ return NULL;
+ }
+
bss = cfg80211_get_bss(wiphy, chan, pBssDesc->bssId,
&roamProfile->SSID.ssId[0], roamProfile->SSID.length,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 8c205097ffa0..c4eef17f6440 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -1725,6 +1725,11 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc)
}
#if defined(QCA_WIFI_2_0) && !defined(QCA_WIFI_ISOC)
+ if (!hif_sc) {
+ hddLog(VOS_TRACE_LEVEL_FATAL, "%s: hif_sc is NULL", __func__);
+ goto err_re_init;
+ }
+
/* Initialize the adf_ctx handle */
adf_ctx = vos_mem_malloc(sizeof(adf_os_device_t));
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index a2f04a5bf6b3..9ce13f5ec953 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -4713,7 +4713,8 @@ VOS_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
(chan_list_fp->num_chan * sizeof(u_int32_t)));
roam_chan_list_array = (A_UINT32 *)(buf_ptr + WMI_TLV_HDR_SIZE);
WMA_LOGI("%s: %d channels = ", __func__, chan_list_fp->num_chan);
- for (i = 0; i < chan_list_fp->num_chan; i++) {
+ for (i = 0; ((i < chan_list_fp->num_chan) &&
+ (i < SIR_ROAM_MAX_CHANNELS)); i++) {
roam_chan_list_array[i] = vos_chan_to_freq(chan_list[i]);
WMA_LOGI("%d,",roam_chan_list_array[i]);
}