diff options
| author | Naveen Rawat <naveenrawat@codeaurora.org> | 2017-01-27 11:20:26 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-01-30 12:42:04 -0800 |
| commit | 4597eae120c664bcbb244f2d3500edae6ae9f9f8 (patch) | |
| tree | f853411475a55bd7a60ae02c5799feba85bd0127 | |
| parent | 81b2c0945b317cf5ed95f1fddb496f192c13b65e (diff) | |
qcacld-3.0: Fix memory leak in wma_mgmt_rx_process
Fix memory leak in wma_mgmt_rx_process, by moving memory alloc below
all the sanity checks.
Change-Id: I2e0663aefb9a7005910bcf0f3a0c1689084ef38e
CRs-Fixed: 1116649
| -rw-r--r-- | core/wma/src/wma_mgmt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 3a92298b1973..e6d40b2cc2c6 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -3192,12 +3192,6 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data, return -EINVAL; } - rx_pkt = qdf_mem_malloc(sizeof(*rx_pkt)); - if (!rx_pkt) { - WMA_LOGE("Failed to allocate rx packet"); - return -ENOMEM; - } - if (cds_is_load_or_unload_in_progress()) { WMA_LOGW(FL("Load/Unload in progress")); return -EINVAL; @@ -3208,6 +3202,12 @@ static int wma_mgmt_rx_process(void *handle, uint8_t *data, return -EINVAL; } + rx_pkt = qdf_mem_malloc(sizeof(*rx_pkt)); + if (!rx_pkt) { + WMA_LOGE("Failed to allocate rx packet"); + return -ENOMEM; + } + qdf_mem_zero(rx_pkt, sizeof(*rx_pkt)); /* |
