Commit 14dbb791 authored by Hans de Goede's avatar Hans de Goede Committed by Zheng Yejian
Browse files

platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios

mainline inclusion
from mainline-v5.13-rc3
commit 3a535874
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I956GN
CVE: CVE-2021-47073

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=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: 1a258e67 ("platform/x86: dell-smbios-wmi: Add new WMI dispatcher driver")
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@outlook.com>
Reviewed-by: default avatarMark Gross <mgross@linux.intel.com>
Link: https://lore.kernel.org/r/20210518125027.21824-1-hdegoede@redhat.com



Conflict:
	drivers/platform/x86/dell-smbios-wmi.c
Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
parent 415aa2f1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment