summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaidiReddy Yenuga <c_saidir@qti.qualcomm.com>2016-07-14 17:19:36 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-07-21 16:44:18 +0530
commitd13ec2d2d666891a82d2575ec5df09bc9bddf9f0 (patch)
tree4ea96711ecbd66e83f1e1c21018743b08580e43b
parent9890e99ff774b433c3f0dfc29495645d4c4de759 (diff)
qcacld-2.0: Add NULL Check in rps indication send API
In hdd_dp_util_send_rps_ind api adapter can be NULL and cause pointer dereferencing. Add NULL check to avoid pointer dereferencing. CRs-Fixed: 1041679 Change-Id: Ief3c6489748f2dfcc68d7ddb8fb0844c116ea7d4
-rw-r--r--CORE/HDD/src/wlan_hdd_dp_utils.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/CORE/HDD/src/wlan_hdd_dp_utils.c b/CORE/HDD/src/wlan_hdd_dp_utils.c
index 30d53b9213c4..69bc4c7283af 100644
--- a/CORE/HDD/src/wlan_hdd_dp_utils.c
+++ b/CORE/HDD/src/wlan_hdd_dp_utils.c
@@ -235,9 +235,14 @@ void hdd_dp_util_send_rps_ind(hdd_adapter_t *adapter)
{
int i = 0;
uint8_t cpu_map_list_len = 0;
- hdd_context_t *hdd_ctxt = WLAN_HDD_GET_CTX(adapter);
+ hdd_context_t *hdd_ctxt;
struct wlan_rps_data rps_data;
+ if (NULL == adapter)
+ return;
+
+ hdd_ctxt = WLAN_HDD_GET_CTX(adapter);
+
rps_data.num_queues = NUM_TX_QUEUES;
hddLog(LOG1, FL("cpu_map_list '%s'"), hdd_ctxt->cfg_ini->cpu_map_list);
@@ -265,13 +270,11 @@ void hdd_dp_util_send_rps_ind(hdd_adapter_t *adapter)
i, rps_data.cpu_map_list[i]);
}
- if (NULL != adapter) {
- strlcpy(rps_data.ifname, adapter->dev->name,
- sizeof(rps_data.ifname));
- wlan_hdd_send_svc_nlink_msg(hdd_ctxt->radio_index,
- WLAN_SVC_RPS_ENABLE_IND,
- &rps_data, sizeof(rps_data));
- }
+ strlcpy(rps_data.ifname, adapter->dev->name,
+ sizeof(rps_data.ifname));
+ wlan_hdd_send_svc_nlink_msg(hdd_ctxt->radio_index,
+ WLAN_SVC_RPS_ENABLE_IND,
+ &rps_data, sizeof(rps_data));
}
#endif /* QCA_FEATURE_RPS */