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
This commit is contained in:
Lincoln Tran 2021-01-14 10:17:26 -08:00 • committed by Gerrit - the friendly Code Review server
commit 51269e38f7

View file

@ -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;