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:
Armin Wolf
2026-06-12 19:34:49 +02:00
committed by Ilpo Järvinen
parent ca9338dbc6
commit 072841e02c

View File

@@ -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);