wlan: Handle error cases cleanly, during wlan loading
On wlan load failure, make sure BTC, OEM, PTT and CESIUM services
are unregistered.
Change-Id: I15b32fdb5cfae5785311af0960277bd360b49c1b
CRs-Fixed: 2107850
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index ce5e70d..6dc22da 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -12754,7 +12754,7 @@
{
hddLog(VOS_TRACE_LEVEL_FATAL,
"%s: oem_activate_service failed", __func__);
- goto err_reg_netdev;
+ goto err_btc_activate_service;
}
#endif
@@ -12763,7 +12763,7 @@
if(ptt_sock_activate_svc(pHddCtx) != 0)
{
hddLog(VOS_TRACE_LEVEL_FATAL,"%s: ptt_sock_activate_svc failed",__func__);
- goto err_reg_netdev;
+ goto err_oem_activate_service;
}
#endif
@@ -12771,7 +12771,7 @@
if (hdd_open_cesium_nl_sock() < 0)
{
hddLog(VOS_TRACE_LEVEL_FATAL,"%s: hdd_open_cesium_nl_sock failed", __func__);
- goto err_reg_netdev;
+ goto err_ptt_sock_activate_svc;
}
#endif
@@ -12786,7 +12786,7 @@
{
hddLog(VOS_TRACE_LEVEL_ERROR, "%s: wlan_logging_sock_activate_svc"
" failed", __func__);
- goto err_reg_netdev;
+ goto err_open_cesium_nl_sock;
}
//TODO: To Remove enableDhcpDebug and use gEnableDebugLog for
//EAPOL and DHCP
@@ -12956,6 +12956,24 @@
goto success;
+err_open_cesium_nl_sock:
+#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
+ hdd_close_cesium_nl_sock();
+#endif
+
+err_ptt_sock_activate_svc:
+#ifdef PTT_SOCK_SVC_ENABLE
+ ptt_sock_deactivate_svc(pHddCtx);
+#endif
+
+err_oem_activate_service:
+#ifdef FEATURE_OEM_DATA_SUPPORT
+ oem_deactivate_service();
+#endif
+
+err_btc_activate_service:
+ btc_deactivate_service();
+
err_reg_netdev:
unregister_netdevice_notifier(&hdd_netdev_notifier);