linux-brain/drivers/platform
Hans de Goede 6fa78a6b9a platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios
[ Upstream commit 3a53587423d25c87af4b4126a806a0575104b45e ]

init_dell_smbios_wmi() only registers the dell_smbios_wmi_driver on systems
where the Dell WMI interface is supported. While exit_dell_smbios_wmi()
unregisters it unconditionally, this leads to the following oops:

[  175.722921] ------------[ cut here ]------------
[  175.722925] Unexpected driver unregister!
[  175.722939] WARNING: CPU: 1 PID: 3630 at drivers/base/driver.c:194 driver_unregister+0x38/0x40
...
[  175.723089] Call Trace:
[  175.723094]  cleanup_module+0x5/0xedd [dell_smbios]
...
[  175.723148] ---[ end trace 064c34e1ad49509d ]---

Make the unregister happen on the same condition the register happens
to fix this.

Cc: Mario Limonciello <mario.limonciello@outlook.com>
Fixes: 1a258e6704 ("platform/x86: dell-smbios-wmi: Add new WMI dispatcher driver")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mario Limonciello <mario.limonciello@outlook.com>
Reviewed-by: Mark Gross <mgross@linux.intel.com>
Link: https://lore.kernel.org/r/20210518125027.21824-1-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-26 12:05:15 +02:00
..
chrome platform/chrome: cros_ec_spi: Don't overwrite spi::mode 2020-12-30 11:51:23 +01:00
goldfish treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mellanox platform/mellanox: mlxbf-tmfifo: Fix a memory barrier issue 2021-05-26 12:05:15 +02:00
mips MIPS: Loongson: Fix return value of loongson_hwmon_init 2020-01-17 19:48:55 +01:00
olpc Platform: OLPC: Fix probe error handling 2021-03-17 17:03:42 +01:00
x86 platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios 2021-05-26 12:05:15 +02:00
Kconfig platform-drivers-x86 for v5.3-1 2019-07-14 16:51:47 -07:00
Makefile Platform: OLPC: Add XO-1.75 EC driver 2019-05-20 17:27:08 +03:00