summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimanshu Agarwal <himanaga@qti.qualcomm.com>2016-07-07 16:23:24 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-07-13 14:53:13 +0530
commitc072f9b359bdf065a8dad2bf8b1c44d4b683ac2a (patch)
treeb910ced98a25e020bf54be0ce6a260634fc4e673
parentaff34bc81822a80e144858e7292c3898ac7b0ff2 (diff)
qcacld-2.0: Avoid NULL pointer dereference when ASSERT disabled
Avoid NULL pointer dereference when ASSERT is disabled by adding extra handling in epping_tx_complete_multiple. Change-Id: I06696bb2588620244fafde431c4cd56bcb8a4301 CRs-fixed: 1038668
-rw-r--r--CORE/EPPING/src/epping_tx.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/CORE/EPPING/src/epping_tx.c b/CORE/EPPING/src/epping_tx.c
index 74277147b279..8de0b1cb9520 100644
--- a/CORE/EPPING/src/epping_tx.c
+++ b/CORE/EPPING/src/epping_tx.c
@@ -353,15 +353,28 @@ void epping_tx_complete_multiple(void *ctx,
pktSkb=GET_HTC_PACKET_NET_BUF_CONTEXT(htc_pkt);
cookie = htc_pkt->pPktContext;
- ASSERT(pktSkb);
- ASSERT(htc_pkt->pBuffer == adf_nbuf_data(pktSkb));
+ if (!pktSkb) {
+ EPPING_LOG(VOS_TRACE_LEVEL_ERROR,
+ "%s: pktSkb is NULL", __func__);
+ ASSERT(0);
+ } else {
+ if (htc_pkt->pBuffer != adf_nbuf_data(pktSkb)) {
+ EPPING_LOG(VOS_TRACE_LEVEL_ERROR,
+ "%s: htc_pkt buffer not equal to skb->data", __func__);
+ ASSERT(0);
+ }
- /* add this to the list, use faster non-lock API */
- adf_nbuf_queue_add(&skb_queue,pktSkb);
+ /* add this to the list, use faster non-lock API */
+ adf_nbuf_queue_add(&skb_queue,pktSkb);
- if (A_SUCCESS(status)) {
- ASSERT(htc_pkt->ActualLength == adf_nbuf_len(pktSkb));
+ if (A_SUCCESS(status))
+ if (htc_pkt->ActualLength != adf_nbuf_len(pktSkb)) {
+ EPPING_LOG(VOS_TRACE_LEVEL_ERROR,
+ "%s: htc_pkt length not equal to skb->len", __func__);
+ ASSERT(0);
+ }
}
+
EPPING_LOG(VOS_TRACE_LEVEL_INFO,
"%s skb=%p data=%p len=0x%x eid=%d ",
__func__, pktSkb, htc_pkt->pBuffer,