summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Rawat <naveenrawat@codeaurora.org>2017-02-17 14:26:02 -0800
committerqcabuildsw <qcabuildsw@localhost>2017-02-17 17:36:01 -0800
commit166ef64c3c79474d028b93b536869b843a7a7e24 (patch)
tree288f3ba7ec3b1296fe92b4f544769052bee65d77
parentdbae6c684b510275fe9727ef31a84ce5bd152e37 (diff)
qcacld-3.0: Fix possible NULL pointer dereference
Add NULL pointer check before accessing wma handle in wma_utils wma_peer_debug_log and wma_peer_debug_dump API. Change-Id: Ie5dbaad2d416ee5c3684f4dfa9bf81487739e2b0 CRs-Fixed: 2008659
-rw-r--r--core/wma/src/wma_utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 0a7dbd081921..00ed392dff75 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -4052,6 +4052,11 @@ void wma_peer_debug_log(uint8_t vdev_id, uint8_t op,
uint32_t i;
struct peer_debug_rec *rec;
+ if (!wma) {
+ WMA_LOGD("%s: WMA handle NULL. Exiting", __func__);
+ return;
+ }
+
i = wma_next_peer_log_index(&wma->peer_dbg->index,
WMA_PEER_DEBUG_MAX_REC);
rec = &wma->peer_dbg->rec[i];
@@ -4130,6 +4135,11 @@ void wma_peer_debug_dump(void)
struct peer_debug_rec *dbg_rec;
uint64_t startt = 0;
+ if (!wma) {
+ WMA_LOGD("%s: WMA handle NULL. Exiting", __func__);
+ return;
+ }
+
#define DEBUG_CLOCK_TICKS_PER_MSEC 19200
current_index = qdf_atomic_read(&wma->peer_dbg->index);