diff options
| author | Kapil Gupta <kapgupta@codeaurora.org> | 2016-10-01 13:20:20 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-03 17:38:41 -0700 |
| commit | 155748e7b6eab46c1bebcf75cd540c4dc5461769 (patch) | |
| tree | 49572f154b5872134c1813d3e73f31b9e219dd87 | |
| parent | def4fddd4fcb1e6b9b18255f1c9c1760340ac44a (diff) | |
qcacld-3.0: Fix memory leak issue
qcacld-2.0 to qcacld-3.0 propagation
Memory should be allocated to radar_event only when radar phy
event needs to be sent to WMA layer.
Add changes to fix memory leak.
CRs-Fixed: 1065466
Change-Id: Ia3e93ddd47913956c27487472b6a70eb68d63fd9
| -rw-r--r-- | core/wma/src/wma_features.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index b40be6ec7825..84f2f6650c0b 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -7534,12 +7534,6 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic, WMA_LOGE("%s:DFS- Invalid WMA handle", __func__); return -ENOENT; } - radar_event = (struct wma_dfs_radar_indication *) - qdf_mem_malloc(sizeof(struct wma_dfs_radar_indication)); - if (radar_event == NULL) { - WMA_LOGE("%s:DFS- Invalid radar_event", __func__); - return -ENOMEM; - } /* * Do not post multiple Radar events on the same channel. @@ -7552,6 +7546,12 @@ int wma_dfs_indicate_radar(struct ieee80211com *ic, if ((ichan->ic_ieee != (wma->dfs_ic->last_radar_found_chan)) || (pmac->sap.SapDfsInfo.disable_dfs_ch_switch == true)) { + radar_event = (struct wma_dfs_radar_indication *) + qdf_mem_malloc(sizeof(struct wma_dfs_radar_indication)); + if (radar_event == NULL) { + WMA_LOGE(FL("Failed to allocate memory for radar_event")); + return -ENOMEM; + } wma->dfs_ic->last_radar_found_chan = ichan->ic_ieee; /* Indicate the radar event to HDD to stop the netif Tx queues */ wma_radar_event.chan_freq = ichan->ic_freq; |
