mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 15:22:21 -04:00
platform/x86: dell-wmi-base: Fix resource leak on module load failure
We need to properly clean up the SMBIOS request and the privacy driver
when the module load fails.
Fixes: 8af9fa37b8 ("platform/x86: dell-privacy: Add support for Dell hardware privacy")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20260612173451.467629-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
committed by
Ilpo Järvinen
parent
ca9338dbc6
commit
072841e02c
@@ -843,9 +843,22 @@ static int __init dell_wmi_init(void)
|
||||
|
||||
err = dell_privacy_register_driver();
|
||||
if (err)
|
||||
return err;
|
||||
goto out_smbios;
|
||||
|
||||
return wmi_driver_register(&dell_wmi_driver);
|
||||
err = wmi_driver_register(&dell_wmi_driver);
|
||||
if (err)
|
||||
goto out_privacy;
|
||||
|
||||
return 0;
|
||||
|
||||
out_privacy:
|
||||
dell_privacy_unregister_driver();
|
||||
|
||||
out_smbios:
|
||||
if (wmi_requires_smbios_request)
|
||||
dell_wmi_events_set_enabled(false);
|
||||
|
||||
return err;
|
||||
}
|
||||
late_initcall(dell_wmi_init);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user