diff options
author | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2022-12-04 12:32:26 +0800 |
---|---|---|
committer | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2023-04-29 14:47:20 +0000 |
commit | 2ae17194848e5dd02ac854ec88590e61040c3616 (patch) | |
tree | b4616bf52880a7757d02b0c9b6f1d49cf84da40a | |
parent | f183f2c98a6eb1bc120a2bcd2b5e3ca9da0ca7a6 (diff) | |
download | wlan-2ae17194848e5dd02ac854ec88590e61040c3616.tar.gz |
qcacmn: Realloc memory for wmi_service_ext_bitmapandroid-13.0.0_r0.127android-13.0.0_r0.126android-13.0.0_r0.125android-13.0.0_r0.124android-13.0.0_r0.123android-13.0.0_r0.121android-13.0.0_r0.117android-13.0.0_r0.116android-13.0.0_r0.115android-13.0.0_r0.114android-13.0.0_r0.113android-13.0.0_r0.112android-13.0.0_r0.107android-13.0.0_r0.106android-13.0.0_r0.105android-13.0.0_r0.104android-13.0.0_r0.103android-13.0.0_r0.100android-gs-tangorpro-5.10-android13-qpr3android-gs-raviole-5.10-android13-qpr3android-gs-pantah-5.10-android13-qpr3android-gs-lynx-5.10-android13-qpr3android-gs-felix-5.10-android13-qpr3-candroid-gs-felix-5.10-android13-qpr3android-gs-bluejay-5.10-android13-qpr3
Realloc memory for wmi_service_ext_bitmap when
WMI_SERVICE_AVAILABLE_EVENTID event come, and
the num of wmi_service_ext_bitmap large then
previous num.
Bug: 276762572
Test: Regression Test
Change-Id: I2800fe3274e5516369486ef065ce03ba121bd5b3
CRs-Fixed: 3346739
Signed-off-by: Hsiu-Chang Chen <hsiuchangchen@google.com>
(cherry picked from commit 14031fdd0e125d00e2eb12e9d239e81bfb9a01fa)
-rw-r--r-- | qca-wifi-host-cmn/wmi/inc/wmi_unified_priv.h | 3 | ||||
-rw-r--r-- | qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c | 13 |
2 files changed, 13 insertions, 3 deletions
diff --git a/qca-wifi-host-cmn/wmi/inc/wmi_unified_priv.h b/qca-wifi-host-cmn/wmi/inc/wmi_unified_priv.h index 4281b84..aec5693 100644 --- a/qca-wifi-host-cmn/wmi/inc/wmi_unified_priv.h +++ b/qca-wifi-host-cmn/wmi/inc/wmi_unified_priv.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -3046,6 +3046,7 @@ struct wmi_soc { /* WMI service bitmap received from target */ uint32_t *wmi_service_bitmap; uint32_t *wmi_ext_service_bitmap; + uint32_t wmi_ext2_service_bitmap_len; uint32_t *wmi_ext2_service_bitmap; uint32_t services[wmi_services_max]; uint16_t wmi_max_cmds; diff --git a/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c b/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c index 9e5112e..51c5bfd 100644 --- a/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c +++ b/qca-wifi-host-cmn/wmi/src/wmi_unified_tlv.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -10511,12 +10511,21 @@ QDF_STATUS save_ext_service_bitmap_tlv(wmi_unified_t wmi_handle, void *evt_buf, return QDF_STATUS_SUCCESS; } - if (!soc->wmi_ext2_service_bitmap) { + if (!soc->wmi_ext2_service_bitmap || + (param_buf->num_wmi_service_ext_bitmap > + soc->wmi_ext2_service_bitmap_len)) { + if (soc->wmi_ext2_service_bitmap) { + qdf_mem_free(soc->wmi_ext2_service_bitmap); + soc->wmi_ext2_service_bitmap = NULL; + } soc->wmi_ext2_service_bitmap = qdf_mem_malloc(param_buf->num_wmi_service_ext_bitmap * sizeof(uint32_t)); if (!soc->wmi_ext2_service_bitmap) return QDF_STATUS_E_NOMEM; + + soc->wmi_ext2_service_bitmap_len = + param_buf->num_wmi_service_ext_bitmap; } qdf_mem_copy(soc->wmi_ext2_service_bitmap, |