From 96326a4c51f3ab20577f579a318bb55d2ccf582a Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: May 08 2023 09:27:13 +0000 Subject: platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios (git-fixes). --- diff --git a/patches.suse/platform-x86-dell-smbios-wmi-Fix-oops-on-rmmod-dell_.patch b/patches.suse/platform-x86-dell-smbios-wmi-Fix-oops-on-rmmod-dell_.patch new file mode 100644 index 0000000..4475e25 --- /dev/null +++ b/patches.suse/platform-x86-dell-smbios-wmi-Fix-oops-on-rmmod-dell_.patch @@ -0,0 +1,47 @@ +From 3a53587423d25c87af4b4126a806a0575104b45e Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 18 May 2021 14:50:27 +0200 +Subject: [PATCH] platform/x86: dell-smbios-wmi: Fix oops on rmmod dell_smbios +Git-commit: 3a53587423d25c87af4b4126a806a0575104b45e +References: git-fixes +Patch-mainline: v5.13-rc3 + +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 +Fixes: 1a258e670434 ("platform/x86: dell-smbios-wmi: Add new WMI dispatcher driver") +Signed-off-by: Hans de Goede +Reviewed-by: Mario Limonciello +Reviewed-by: Mark Gross +Link: https://lore.kernel.org/r/20210518125027.21824-1-hdegoede@redhat.com +Signed-off-by: Oliver Neukum +--- + drivers/platform/x86/dell-smbios-wmi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/platform/x86/dell-smbios-wmi.c ++++ b/drivers/platform/x86/dell-smbios-wmi.c +@@ -274,7 +274,8 @@ int init_dell_smbios_wmi(void) + + void exit_dell_smbios_wmi(void) + { +- wmi_driver_unregister(&dell_smbios_wmi_driver); ++ if (wmi_supported) ++ wmi_driver_unregister(&dell_smbios_wmi_driver); + } + + MODULE_ALIAS("wmi:" DELL_WMI_SMBIOS_GUID); diff --git a/series.conf b/series.conf index 7ff497d..81bc9d6 100644 --- a/series.conf +++ b/series.conf @@ -60646,6 +60646,7 @@ patches.suse/msft-hv-2317-uio_hv_generic-Fix-another-memory-leak-in-error-hand.patch patches.suse/platform-mellanox-mlxbf-tmfifo-Fix-a-memory-barrier-.patch patches.suse/platform-x86-hp-wireless-add-AMD-s-hardware-id-to-th.patch + patches.suse/platform-x86-dell-smbios-wmi-Fix-oops-on-rmmod-dell_.patch patches.suse/platform-x86-intel_punit_ipc-Append-MODULE_DEVICE_TA.patch patches.suse/ALSA-hda-realtek-reset-eapd-coeff-to-default-value-f.patch patches.suse/ALSA-bebob-oxfw-fix-Kconfig-entry-for-Mackie-d.2-Pro.patch