From cf2db1bee207691dc5ba3d3c50aa1f4717986b34 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Fri, 27 Apr 2018 16:44:53 -0700 Subject: [PATCH] qcacmn: Add NULL pointer check in p2p_remove_tx_context() API Add NULL pointer check in p2p_remove_tx_context() API. CRs-Fixed: 2232786 Change-Id: I67e541573d704f313a48c16c195a626a4040402c --- umac/p2p/core/src/wlan_p2p_off_chan_tx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/umac/p2p/core/src/wlan_p2p_off_chan_tx.c b/umac/p2p/core/src/wlan_p2p_off_chan_tx.c index 75fbcd3c54e8..6af91f761b67 100644 --- a/umac/p2p/core/src/wlan_p2p_off_chan_tx.c +++ b/umac/p2p/core/src/wlan_p2p_off_chan_tx.c @@ -1214,8 +1214,10 @@ static QDF_STATUS p2p_remove_tx_context( &is_ack_q); /* for not off channel tx case, won't find from queue */ - if (!cur_tx_ctx) + if (!cur_tx_ctx) { p2p_debug("Do not find tx context from queue"); + goto end; + } if (is_roc_q) { status = qdf_list_remove_node( @@ -1233,6 +1235,7 @@ static QDF_STATUS p2p_remove_tx_context( p2p_err("Failed to tx context from wait ack req queue"); } +end: qdf_mem_free(tx_ctx->buf); qdf_mem_free(tx_ctx);