From fb02f457044f4b4b889d3f47f2c7175cbcb3dc13 Mon Sep 17 00:00:00 2001 From: Paul Zhang Date: Fri, 22 Dec 2017 11:58:43 +0800 Subject: [PATCH] qcacld-3.0: Register hdd_netdev_notifier properly The statement register_netdevice_notifier(&hdd_netdev_notifier) is replaced by hdd_register_notifiers(hdd_ctx) mistakenly when propagating from 3.1 to 3.2. Change-Id: Iddcc2b0375c0e81b944def117b40ea3015f91e4b CRs-Fixed: 2163113 --- core/hdd/src/wlan_hdd_main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 41d3563dc47e..5baccee0a2c8 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -10275,9 +10275,11 @@ int hdd_wlan_startup(struct device *dev) hdd_initialize_mac_address(hdd_ctx); - ret = hdd_register_notifiers(hdd_ctx); - if (ret) + ret = register_netdevice_notifier(&hdd_netdev_notifier); + if (ret) { + hdd_err("register_netdevice_notifier failed: %d", ret); goto err_ipa_cleanup; + } rtnl_held = hdd_hold_rtnl_lock(); @@ -10309,10 +10311,16 @@ int hdd_wlan_startup(struct device *dev) if (hdd_ctx->rps) hdd_set_rps_cpu_mask(hdd_ctx); - status = wlansap_global_init(); - if (QDF_IS_STATUS_ERROR(status)) + ret = hdd_register_notifiers(hdd_ctx); + if (ret) goto err_close_adapters; + status = wlansap_global_init(); + if (QDF_IS_STATUS_ERROR(status)) { + hdd_unregister_notifiers(hdd_ctx); + goto err_close_adapters; + } + if (hdd_ctx->config->fIsImpsEnabled) hdd_set_idle_ps_config(hdd_ctx, true); else