Commit ee3399e5 authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho

iwlwifi: fix module init error paths

When the module fails to initialize for some reason, it
doesn't clean up properly. Fix that.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 5cc74f65
...@@ -1745,7 +1745,7 @@ IWL_EXPORT_SYMBOL(iwl_opmode_deregister); ...@@ -1745,7 +1745,7 @@ IWL_EXPORT_SYMBOL(iwl_opmode_deregister);
static int __init iwl_drv_init(void) static int __init iwl_drv_init(void)
{ {
int i; int i, err;
mutex_init(&iwlwifi_opmode_table_mtx); mutex_init(&iwlwifi_opmode_table_mtx);
...@@ -1760,7 +1760,17 @@ static int __init iwl_drv_init(void) ...@@ -1760,7 +1760,17 @@ static int __init iwl_drv_init(void)
iwl_dbgfs_root = debugfs_create_dir(DRV_NAME, NULL); iwl_dbgfs_root = debugfs_create_dir(DRV_NAME, NULL);
#endif #endif
return iwl_pci_register_driver(); err = iwl_pci_register_driver();
if (err)
goto cleanup_debugfs;
return 0;
cleanup_debugfs:
#ifdef CONFIG_IWLWIFI_DEBUGFS
debugfs_remove_recursive(iwl_dbgfs_root);
#endif
return err;
} }
module_init(iwl_drv_init); module_init(iwl_drv_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment