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

Commit 40f43388 authored by Will Huang's avatar Will Huang Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: Fix unsafe channel buffer size not align

qdf_freq_t is by default defined as uint32_t, but hdd_ctx->
unsafe_channel_list is defined as uin16_t because cnss interface
is defined as uint16_t, so can't pass hdd_ctx->unsafe_channel_list
to ucfg_policy_mgr_init_chan_avoidance() which expect qdf_freq_t
list.

Convert hdd_ctx->unsafe_channel_list to qdf_freq_t list and pass
it to ucfg_policy_mgr_init_chan_avoidance().

Change-Id: I0207827e3cbaa82526e97d2826d90d396148c84a
CRs-Fixed: 2964178
parent 7db94035
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -11928,6 +11928,7 @@ static void hdd_init_channel_avoidance(struct hdd_context *hdd_ctx)
{
	uint16_t unsafe_channel_count;
	int index;
	qdf_freq_t *unsafe_freq_list;
	pld_get_wlan_unsafe_channel(hdd_ctx->parent_dev,
				    hdd_ctx->unsafe_channel_list,
@@ -11940,16 +11941,25 @@ static void hdd_init_channel_avoidance(struct hdd_context *hdd_ctx)
	unsafe_channel_count = QDF_MIN((uint16_t)hdd_ctx->unsafe_channel_count,
				       (uint16_t)NUM_CHANNELS);
	unsafe_freq_list = qdf_mem_malloc(
			unsafe_channel_count * sizeof(*unsafe_freq_list));
	if (!unsafe_freq_list)
		return;
	for (index = 0; index < unsafe_channel_count; index++) {
		hdd_debug("channel frequency %d is not safe",
			  hdd_ctx->unsafe_channel_list[index]);
		unsafe_freq_list[index] =
			(qdf_freq_t)hdd_ctx->unsafe_channel_list[index];
	}
	ucfg_policy_mgr_init_chan_avoidance(
		hdd_ctx->psoc,
		(qdf_freq_t *)hdd_ctx->unsafe_channel_list,
		hdd_ctx->unsafe_channel_count);
		unsafe_freq_list,
		unsafe_channel_count);
	qdf_mem_free(unsafe_freq_list);
}
static void hdd_lte_coex_restart_sap(struct hdd_adapter *adapter,