From e906b00a65edb4d670458093eaf20327063cb209 Mon Sep 17 00:00:00 2001 From: Surabhi Vishnoi Date: Tue, 6 Oct 2020 11:59:23 +0530 Subject: [PATCH] qcacmn: Fix the incorrect check in is_service_enabled_tlv Many firmware do not send wmi_ext_service bitmap in wmi_ready event so the ext_service_bitmap will be empty in such cases. So the condition in the is_service_enabled_tlv to check for wmi_ext_service bitmap and return false is wrong as wmi_ext_service bitmap support is not necessity. This condition leads to incorrect behavior in cases when firmware do not support wmi_ext_service bitmap as is_service_enabled_tlv returns false for every service. Fix the above failure by addition of condition check for wmi_ext_service bitmap only when wmi_ext2_service bitmap is supported by firmware. Change-Id: I94d0b65e640d44f41d14de889955a6d6330e88b2 CRs-Fixed: 2786491 --- wmi/src/wmi_unified_tlv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 11b5141487..4504ab0b21 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -8676,19 +8676,19 @@ static bool is_service_enabled_tlv(wmi_unified_t wmi_handle, return false; } - if (!soc->wmi_ext_service_bitmap) { - wmi_err("WMI service ext bit map is not saved yet"); - return false; - } - /* if wmi_service_enabled was received with extended2 bitmap, * use WMI_SERVICE_EXT2_IS_ENABLED to check the services. */ - if (soc->wmi_ext2_service_bitmap) + if (soc->wmi_ext2_service_bitmap) { + if (!soc->wmi_ext_service_bitmap) { + wmi_err("WMI service ext bit map is not saved yet"); + return false; + } return WMI_SERVICE_EXT2_IS_ENABLED(soc->wmi_service_bitmap, soc->wmi_ext_service_bitmap, soc->wmi_ext2_service_bitmap, service_id); + } if (service_id >= WMI_MAX_EXT_SERVICE) { wmi_err("Service id %d but WMI ext2 service bitmap is NULL",