From c48ad6ed1f3eae653068ae818d87a357d62608a8 Mon Sep 17 00:00:00 2001 From: Varun Reddy Yeturu Date: Fri, 9 Sep 2016 14:31:58 -0700 Subject: qcacld-3.0: Check WMA for NULL before dereferencing Once WMA context is retrieved, check if it has NULL value before dereferencing it Change-Id: I9896204933deb0588bca51e006e1477d5ed6c03e CRs-Fixed: 1065301 --- core/wma/src/wma_features.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core') diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index a308b0b9da47..19fc684022cd 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -7982,6 +7982,11 @@ int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf, wmi_p2p_lo_stopped_event_fixed_param *fix_param; tpAniSirGlobal p_mac = cds_get_context(QDF_MODULE_ID_PE); + if (!wma) { + WMA_LOGE("%s: Invalid WMA Context", __func__); + return -EINVAL; + } + if (!p_mac) { WMA_LOGE("%s: Invalid p_mac", __func__); return -EINVAL; -- cgit v1.2.3