From 21282ecd17411dc7b59e0f89afa017220de84e8a Mon Sep 17 00:00:00 2001 From: Nishank Aggarwal Date: Thu, 1 Dec 2016 17:41:33 +0530 Subject: [PATCH] qcacld-3.0: Add Null check before dereference of pointer Add check for NULL for pointer before dereferencing them. Change-Id: I1093f25ae67b8ce75a69f88516be2ca810fc28e0 CRs-Fixed: 1096195 --- core/wma/src/wma_mgmt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 2008e53f2c..d3bf3c3042 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -3055,6 +3055,7 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle, void *pdev_ctx; uint8_t peer_id; bool should_drop = false; + qdf_time_t *ptr; void *soc = cds_get_context(QDF_MODULE_ID_SOC); /* @@ -3089,7 +3090,12 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle, switch (subtype) { case SIR_MAC_MGMT_ASSOC_REQ: - if (*cdp_peer_last_assoc_received(soc, peer)) { + ptr = cdp_peer_last_assoc_received(soc, peer); + if (ptr == NULL) { + WMA_LOGE(FL("cdp_peer_last_assoc_received Failed")); + should_drop = true; + goto end; + } else { if ((qdf_get_system_timestamp() - *cdp_peer_last_assoc_received(soc, peer)) < WMA_MGMT_FRAME_DETECT_DOS_TIMER) {