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
This commit is contained in:
Jeff Johnson
2017-02-01 15:31:16 -08:00
committed by qcabuildsw
부모 b90ab57f0c
커밋 46bde3845d

파일 보기

@@ -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: