Skip to content
Commit 812fcc60 authored by Alex Williamson's avatar Alex Williamson Committed by Hans de Goede
Browse files

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: a40cd7ef

 ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Reviewed-by: default avatarMark Gross <markgross@kernel.org>
Reviewed-by: default avatarMark Pearson <markpearson@lenovo.com>
Link: https://lore.kernel.org/r/163639463588.1330483.15850167112490200219.stgit@omen


Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 0f07c023
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment