Procházet zdrojové kódy

qcacld-3.0: Add null check for hdd_ctx in mode change shutdown/restart

Add null check for hdd_ctx in mode change shutdown and restart callbacks.

Change-Id: I03be071f44b7315aab18d8d38250709553a20a9e
CRs-Fixed: 2475044
Rajeev Kumar před 5 roky
rodič
revize
47b772928b
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      core/hdd/src/wlan_hdd_main.c

+ 6 - 0
core/hdd/src/wlan_hdd_main.c

@@ -13628,6 +13628,9 @@ static int hdd_mode_change_psoc_idle_shutdown(struct device *dev)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
+	if (!hdd_ctx)
+		return -EINVAL;
+
 	return hdd_wlan_stop_modules(hdd_ctx, true);
 }
 
@@ -13635,6 +13638,9 @@ static int hdd_mode_change_psoc_idle_restart(struct device *dev)
 {
 	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
 
+	if (!hdd_ctx)
+		return -EINVAL;
+
 	return hdd_wlan_start_modules(hdd_ctx, false);
 }