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

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
Loading
Loading
Loading
Loading
+12 −2
Original line number Original line Diff line number Diff line
@@ -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)
	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);