summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_hostapd.c6
-rw-r--r--core/hdd/src/wlan_hdd_ioctl.c12
2 files changed, 11 insertions, 7 deletions
diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c
index 9844411aaecb..fad7bb785f10 100644
--- a/core/hdd/src/wlan_hdd_hostapd.c
+++ b/core/hdd/src/wlan_hdd_hostapd.c
@@ -7883,6 +7883,12 @@ int wlan_hdd_restore_channels(hdd_context_t *hdd_ctx)
status = sme_update_channel_list(hdd_ctx->hHal);
if (status)
hdd_err("Can't Restore channel list");
+ else
+ /*
+ * Free the cache channels when the
+ * disabled channels are restored
+ */
+ wlan_hdd_free_cache_channels(hdd_ctx);
EXIT();
return 0;
diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c
index d4e019f5bb0d..207d48b91468 100644
--- a/core/hdd/src/wlan_hdd_ioctl.c
+++ b/core/hdd/src/wlan_hdd_ioctl.c
@@ -7259,13 +7259,11 @@ static int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, uint8_t *ptr)
hdd_debug("Number of channel to disable are: %d", temp_int);
if (!temp_int) {
- if (!wlan_hdd_restore_channels(hdd_ctx)) {
- /*
- * Free the cache channels only when the command is
- * received with num channels as 0
- */
- wlan_hdd_free_cache_channels(hdd_ctx);
- }
+ /*
+ * Restore and Free the cache channels when the command is
+ * received with num channels as 0
+ */
+ wlan_hdd_restore_channels(hdd_ctx);
return 0;
}