[Bugfix] reboot while goto sleep on condition of wifi driver unloaded

Change-Id: I9f1e74458915170fdfc2c5bb4a43e89810c63be9
diff --git a/src/kernel/linux/v4.19/drivers/net/wireless/bcmdhd/dhd_linux_lb.c b/src/kernel/linux/v4.19/drivers/net/wireless/bcmdhd/dhd_linux_lb.c
index 0cb4f99..1dc5c4e 100644
--- a/src/kernel/linux/v4.19/drivers/net/wireless/bcmdhd/dhd_linux_lb.c
+++ b/src/kernel/linux/v4.19/drivers/net/wireless/bcmdhd/dhd_linux_lb.c
@@ -33,6 +33,7 @@
 #include <dhd_linux_priv.h>
 
 extern dhd_pub_t* g_dhd_pub;
+static int g_cpuhp_state = 0; //cy add to fix reboot when sleep 2022-05-23
 
 #if defined(DHD_LB)
 
@@ -318,6 +319,7 @@
 	dhd->cpu_notifier.notifier_call = dhd_cpu_callback;
 	register_hotcpu_notifier(&dhd->cpu_notifier); /* Register a callback */
 #endif /* LINUX_VERSION_CODE < 4.10.0 */
+	g_cpuhp_state = cpuhp_ret; //cy add to fix reboot when sleep 2022-05-23
 	return cpuhp_ret;
 }
 
@@ -326,7 +328,11 @@
 	int ret = 0;
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))
 	/* Don't want to call tear down while unregistering */
-	cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
+	//cy add to fix reboot when sleep 2022-05-23 begin
+	if (g_cpuhp_state != 0) {
+		cpuhp_remove_state_nocalls(g_cpuhp_state);
+	}
+	//cy add to fix reboot when sleep 2022-05-23 end
 #else
 	if (dhd->cpu_notifier.notifier_call != NULL) {
 		unregister_cpu_notifier(&dhd->cpu_notifier);