From 6176bef9d376b8a84f19c8297f82e919670f3344 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Thu, 25 Jul 2019 15:51:35 +0530 Subject: [PATCH] qcacld-3.0: Free cached channel list with restore channels When driver receives the command to disable the channels it maintains a list of the channels which are disabled. During SAP stop, driver restores the disabled channels but it is not freeing the cache list. Now when again the command is issued to disable the channels, driver is not processing this command as it still has the channels in its cached list which were disabled during previous command. This results into failure of current command and all the subsequent commands to disable the channels until the cache list is not cleared with set_disable_channel_list command with empty channel list. To address above issue, clear the cache channel list as soon as driver restores the channels on stop bss. Change-Id: I6b8c7ba250ef38b892ab83621add45fbfc09a2cd CRs-fixed: 2496642 --- core/hdd/src/wlan_hdd_hostapd.c | 7 ++++++- core/hdd/src/wlan_hdd_ioctl.c | 12 +++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 5c6456ddff45..2e6c7e325ac5 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -4714,8 +4714,13 @@ int wlan_hdd_restore_channels(struct hdd_context *hdd_ctx, status = sme_update_channel_list(hdd_ctx->mac_handle); 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); hdd_exit(); - return 0; } diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 70fab802d039..26b2722b35e0 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -7205,13 +7205,11 @@ static int hdd_parse_disable_chan_cmd(struct hdd_adapter *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, false)) { - /* - * 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, false); return 0; }