Переглянути джерело

qcacld-3.0: Add freq check before checking if it is disabled

When the country code is updated, there is logic to check if a restart
of the adapter is needed. In this logic, there is a call to see if the
home channel is disabled. Sometimes, the home channel is 0 since it
has not been set yet, causing extra debug prints. To avoid this, ensure
the home channel is set before calling other APIs.

Change-Id: I58021f7f703761450c73a524c5acb51ddc7ad5ef
CRs-fixed: 2923754
Lincoln Tran 4 роки тому
батько
коміт
58394c6586
1 змінених файлів з 5 додано та 1 видалено
  1. 5 1
      core/hdd/src/wlan_hdd_regulatory.c

+ 5 - 1
core/hdd/src/wlan_hdd_regulatory.c

@@ -1431,7 +1431,11 @@ static void hdd_country_change_update_sta(struct hdd_context *hdd_ctx)
 	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
 					   dbgid) {
 		oper_freq = hdd_get_adapter_home_channel(adapter);
-		freq_changed = wlan_reg_is_disable_for_freq(pdev, oper_freq);
+		if (oper_freq)
+			freq_changed = wlan_reg_is_disable_for_freq(pdev,
+								    oper_freq);
+		else
+			freq_changed = false;
 
 		switch (adapter->device_mode) {
 		case QDF_P2P_CLIENT_MODE: