From 51269e38f70a4ee8f17b39153ffaaa5e73ec301b Mon Sep 17 00:00:00 2001 From: Lincoln Tran Date: Thu, 14 Jan 2021 10:17:26 -0800 Subject: [PATCH] qcacmn: Initialize txpower to 0 In the API reg_find_txpower_from_6g_list, if the frequency is not found, txpower is not touched and could cause undefined behavior. Initialize it to 0. Change-Id: Ic65c678144bf88959407ef28ab0d401278fa4738 CRs-fixed: 2855200 --- umac/regulatory/core/src/reg_services_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 0651cc2b4ad5..51983374d53f 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -4337,6 +4337,8 @@ reg_find_txpower_from_6g_list(qdf_freq_t freq, { enum channel_enum chan_enum; + *txpower = 0; + for (chan_enum = 0; chan_enum < NUM_6GHZ_CHANNELS; chan_enum++) { if (chan_list[chan_enum].center_freq == freq) { *txpower = chan_list[chan_enum].tx_power;