Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bffcedd authored by chunquan's avatar chunquan Committed by Madan Koyyalamudi
Browse files

qcacmn: Realloc memory for wmi_service_ext_bitmap

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.

Change-Id: I2800fe3274e5516369486ef065ce03ba121bd5b3
CRs-Fixed: 3346739
parent 2a7bc9c2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 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
@@ -2653,6 +2654,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;
+11 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 * Copyright (c) 2022-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
@@ -9685,12 +9685,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,