From b0b8c6afb5b58f80078535ce26a95b0fa2828ba1 Mon Sep 17 00:00:00 2001 From: Srinivas Dasari Date: Thu, 21 Oct 2021 17:31:29 +0530 Subject: [PATCH] qcacld-3.0: Drop the blacklist event if no APs are present Currently, target_if forwards the blacklist event to upper layers even if there is no AP info present. This event can be dropped in target_if to avoid accessing unallocated memory. Change-Id: Icfaabb0a8e3304882979ffde7f5cd27fd4c8a067 CRs-Fixed: 3057424 --- .../target_if/connection_mgr/src/target_if_cm_roam_event.c | 6 ++++++ components/wmi/src/wmi_unified_roam_tlv.c | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/components/target_if/connection_mgr/src/target_if_cm_roam_event.c b/components/target_if/connection_mgr/src/target_if_cm_roam_event.c index c4b5704d36..c01e49e6da 100644 --- a/components/target_if/connection_mgr/src/target_if_cm_roam_event.c +++ b/components/target_if/connection_mgr/src/target_if_cm_roam_event.c @@ -259,6 +259,12 @@ target_if_cm_btm_blacklist_event(ol_scn_t scn, uint8_t *event, uint32_t len) return -EINVAL; } + if (!dst_list) { + /* No APs to blacklist, just return */ + target_if_err_rl("No APs in blacklist received"); + return 0; + } + roam_rx_ops = target_if_cm_get_roam_rx_ops(psoc); if (!roam_rx_ops || !roam_rx_ops->btm_blacklist_event) { target_if_err("No valid roam rx ops"); diff --git a/components/wmi/src/wmi_unified_roam_tlv.c b/components/wmi/src/wmi_unified_roam_tlv.c index c94759c5f1..f64f37865b 100644 --- a/components/wmi/src/wmi_unified_roam_tlv.c +++ b/components/wmi/src/wmi_unified_roam_tlv.c @@ -2711,11 +2711,8 @@ extract_btm_blacklist_event(wmi_unified_t wmi_handle, } num_entries = param_buf->num_blacklist_with_timeout; - if (num_entries == 0) { - /* no aps to blacklist just return*/ - wmi_err("No APs in blacklist received"); + if (num_entries == 0) return QDF_STATUS_SUCCESS; - } if (num_entries > MAX_RSSI_AVOID_BSSID_LIST) { wmi_err("num blacklist entries:%d exceeds maximum value",