From d1ae706c831e95331b64a256c1107d2c18c56f80 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 1 Feb 2017 15:31:16 -0800 Subject: qcacld-3.0: Fix rtnl_lock usage in HDD startup failure path Currently in the error-handling path of hdd_wlan_startup() there are two issues with respect to the rtnl_lock: 1) hdd_close_all_adapters() may be called with the rtnl_lock parameter set to false even though the rtnl_lock is being held. 2) the function could possibly take the rtnl_lock and never release it. Fix these issues in hdd_wlan_startup(). Change-Id: Iaa69d540dd7663355ceb66f6bc8ba0e5dd8c228e CRs-Fixed: 2001611 --- core/hdd/src/wlan_hdd_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2a8ae3ad5ece..e8ef3c6b27c7 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8272,7 +8272,7 @@ int hdd_wlan_startup(struct device *dev) if (IS_ERR(adapter)) { hdd_alert("Failed to open interface, adapter is NULL"); ret = PTR_ERR(adapter); - goto err_ipa_cleanup; + goto err_release_rtnl_lock; } hif_sc = cds_get_context(QDF_MODULE_ID_HIF); @@ -8368,12 +8368,12 @@ err_debugfs_exit: hdd_debugfs_exit(adapter); err_close_adapter: - hdd_close_all_adapters(hdd_ctx, false); + hdd_close_all_adapters(hdd_ctx, rtnl_held); +err_release_rtnl_lock: if (rtnl_held) hdd_release_rtnl_lock(); -err_ipa_cleanup: hdd_ipa_cleanup(hdd_ctx); err_wiphy_unregister: -- cgit v1.2.3