summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasti, Narayanraddi <c_nmasti@qti.qualcomm.com>2015-05-09 17:28:53 +0530
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-05-19 15:58:25 +0530
commit954f17a1c1ebcfec1d10bb8e786ee153bf70619b (patch)
treeec1d574e8bd50e4ebb010f5ae6d350a4d233c1df
parent69df5d25074398903dac85b98d73c9e16f68ab10 (diff)
qcacld-2.0: Fix Suspicious pointer dereference
Suspicious dereference of pointer during miracast mode setting before Null check. To mitigate this include Null check before pointer access. Change-Id: I4bc46ca26c784b0187cef1b7e3ec8fdee907eeaa CRs-Fixed: 835212
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index ab6fdb1adfe5..814ae2726bcf 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -3625,18 +3625,23 @@ static void hdd_wma_send_fastreassoc_cmd(int sessionId, tSirMacAddr bssid,
*/
int hdd_set_miracast_mode(hdd_adapter_t *pAdapter, tANI_U8 *command)
{
- tHalHandle hHal = WLAN_HDD_GET_CTX(pAdapter)->hHal;
+ tHalHandle hHal;
tANI_U8 filterType = 0;
hdd_context_t *pHddCtx = NULL;
tANI_U8 *value;
int ret;
eHalStatus ret_status;
- value = command + 9;
-
pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
- if (!pHddCtx)
- return -EFAULT;
+ if (0 != wlan_hdd_validate_context(pHddCtx)) {
+ VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+ FL("pHddCtx is not valid, Unable to set miracast mode"));
+ return -EINVAL;
+ }
+
+ hHal = pHddCtx->hHal;
+
+ value = command + 9;
/* Convert the value from ascii to integer */
ret = kstrtou8(value, 10, &filterType);