From 46bde3845d6edd433a1f686cb037a0347f8e573f Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 1 Feb 2017 15:31:16 -0800 Subject: [PATCH] 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 03bfd3405015..802a362b41fe 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -8300,7 +8300,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); @@ -8395,12 +8395,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: