summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Seto <wseto@qti.qualcomm.com>2014-06-17 10:54:52 -0700
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-06-21 02:10:03 -0700
commite1eef934e6e2ffd2e67daccec831881bd9d83bf6 (patch)
tree046f4a51e6ce28a3b42247376c147169bc6c0bea
parente89df48ae0e1b75ed186e406bc0329b9d974bfc2 (diff)
wlan-cld: NULL pointer dereference in wlan_hdd_p2p.c
Currently cfgState->remain_on_chan_ctx is assigned to pRemainChanCtx without NULL check of cfgState. Added a NULL check prior to assignment. Change-Id: I5b530c15f1e611b287e702b0c69aaff16fd08915 CRs-Fixed: 680921
-rw-r--r--CORE/HDD/src/wlan_hdd_p2p.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c
index 71adf1bbba5a..64572fb0480e 100644
--- a/CORE/HDD/src/wlan_hdd_p2p.c
+++ b/CORE/HDD/src/wlan_hdd_p2p.c
@@ -723,10 +723,16 @@ int wlan_hdd_cfg80211_remain_on_channel( struct wiphy *wiphy,
void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter )
{
- hdd_cfg80211_state_t *cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter );
- hdd_remain_on_chan_ctx_t* pRemainChanCtx;
+ hdd_cfg80211_state_t *cfgState = NULL;
+ hdd_remain_on_chan_ctx_t* pRemainChanCtx = NULL;
VOS_STATUS status;
+ if (NULL == pAdapter)
+ {
+ hddLog(LOGE, FL("pAdapter is NULL"));
+ return;
+ }
+ cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter );
hddLog( LOG1, "Ready on chan ind");
mutex_lock(&cfgState->remain_on_chan_ctx_lock);