Procházet zdrojové kódy

qcacmn: Add pdev NULL check in reg_set_country

reg_set_country may be called by hdd_reg_notifier, which is running
in a context of worker create outside driver, it may be scheduled to
run during driver unloading process which set hdd_ctx->hdd_pdev to 0.

Change-Id: Ie51d772294302ad6b04117847c28a556694e9bca
CRs-Fixed: 2208085
Will Huang před 7 roky
rodič
revize
fb82d53055
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      umac/regulatory/core/src/reg_services.c

+ 5 - 0
umac/regulatory/core/src/reg_services.c

@@ -1413,6 +1413,11 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev,
 	struct wlan_objmgr_psoc *psoc;
 	struct cc_regdmn_s rd;
 
+	if (!pdev) {
+		reg_err("pdev is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
 	if (!country) {
 		reg_err("country code is NULL");
 		return QDF_STATUS_E_INVAL;