aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/think-lmi.h
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2021-11-08 11:03:57 -0700
committerHans de Goede <hdegoede@redhat.com>2021-11-16 10:56:53 +0100
commit812fcc609502096e98cc3918a4b807722dba8fd9 (patch)
treee33425a79656bebbf652cfc099e3fbfcdeb8bcfe /drivers/platform/x86/think-lmi.h
parentplatform/x86: dell-wmi-descriptor: disable by default (diff)
downloadlinux-dev-812fcc609502096e98cc3918a4b807722dba8fd9.tar.xz
linux-dev-812fcc609502096e98cc3918a4b807722dba8fd9.zip
platform/x86: think-lmi: Abort probe on analyze failure
A Lenovo ThinkStation S20 (4157CTO BIOS 60KT41AUS) fails to boot on recent kernels including the think-lmi driver, due to the fact that errors returned by the tlmi_analyze() function are ignored by tlmi_probe(), where tlmi_sysfs_init() is called unconditionally. This results in making use of an array of already freed, non-null pointers and other uninitialized globals, causing all sorts of nasty kobject and memory faults. Make use of the analyze function return value, free a couple leaked allocations, and remove the settings_count field, which is incremented but never consumed. Fixes: a40cd7ef22fb ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms") Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Reviewed-by: Mark Gross <markgross@kernel.org> Reviewed-by: Mark Pearson <markpearson@lenovo.com> Link: https://lore.kernel.org/r/163639463588.1330483.15850167112490200219.stgit@omen Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/think-lmi.h')
-rw-r--r--drivers/platform/x86/think-lmi.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/platform/x86/think-lmi.h b/drivers/platform/x86/think-lmi.h
index f8e26823075f..2ce5086a5af2 100644
--- a/drivers/platform/x86/think-lmi.h
+++ b/drivers/platform/x86/think-lmi.h
@@ -55,7 +55,6 @@ struct tlmi_attr_setting {
struct think_lmi {
struct wmi_device *wmi_device;
- int settings_count;
bool can_set_bios_settings;
bool can_get_bios_selections;
bool can_set_bios_password;