Commit 8dfab523 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'platform-drivers-x86-v6.3-5' of...

Merge tag 'platform-drivers-x86-v6.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86

Pull x86 platform driver fixes from Hans de Goede:

 -  more think-lmi fixes

 -  one DMI quirk addition

* tag 'platform-drivers-x86-v6.3-5' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
  platform/x86: thinkpad_acpi: Add missing T14s Gen1 type to s2idle quirk list
  platform/x86: think-lmi: Clean up display of current_value on Thinkstation
  platform/x86: think-lmi: Fix memory leaks when parsing ThinkStation WMI strings
  platform/x86: think-lmi: Fix memory leak when showing current settings
parents fcff5f99 9a469c6d
...@@ -920,7 +920,7 @@ static ssize_t display_name_show(struct kobject *kobj, struct kobj_attribute *at ...@@ -920,7 +920,7 @@ static ssize_t display_name_show(struct kobject *kobj, struct kobj_attribute *at
static ssize_t current_value_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) static ssize_t current_value_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{ {
struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj); struct tlmi_attr_setting *setting = to_tlmi_attr_setting(kobj);
char *item, *value; char *item, *value, *p;
int ret; int ret;
ret = tlmi_setting(setting->index, &item, LENOVO_BIOS_SETTING_GUID); ret = tlmi_setting(setting->index, &item, LENOVO_BIOS_SETTING_GUID);
...@@ -930,10 +930,15 @@ static ssize_t current_value_show(struct kobject *kobj, struct kobj_attribute *a ...@@ -930,10 +930,15 @@ static ssize_t current_value_show(struct kobject *kobj, struct kobj_attribute *a
/* validate and split from `item,value` -> `value` */ /* validate and split from `item,value` -> `value` */
value = strpbrk(item, ","); value = strpbrk(item, ",");
if (!value || value == item || !strlen(value + 1)) if (!value || value == item || !strlen(value + 1))
return -EINVAL; ret = -EINVAL;
else {
ret = sysfs_emit(buf, "%s\n", value + 1); /* On Workstations remove the Options part after the value */
p = strchrnul(value, ';');
*p = '\0';
ret = sysfs_emit(buf, "%s\n", value + 1);
}
kfree(item); kfree(item);
return ret; return ret;
} }
...@@ -1457,10 +1462,10 @@ static int tlmi_analyze(void) ...@@ -1457,10 +1462,10 @@ static int tlmi_analyze(void)
* name string. * name string.
* Try and pull that out if it's available. * Try and pull that out if it's available.
*/ */
char *item, *optstart, *optend; char *optitem, *optstart, *optend;
if (!tlmi_setting(setting->index, &item, LENOVO_BIOS_SETTING_GUID)) { if (!tlmi_setting(setting->index, &optitem, LENOVO_BIOS_SETTING_GUID)) {
optstart = strstr(item, "[Optional:"); optstart = strstr(optitem, "[Optional:");
if (optstart) { if (optstart) {
optstart += strlen("[Optional:"); optstart += strlen("[Optional:");
optend = strstr(optstart, "]"); optend = strstr(optstart, "]");
...@@ -1469,6 +1474,7 @@ static int tlmi_analyze(void) ...@@ -1469,6 +1474,7 @@ static int tlmi_analyze(void)
kstrndup(optstart, optend - optstart, kstrndup(optstart, optend - optstart,
GFP_KERNEL); GFP_KERNEL);
} }
kfree(optitem);
} }
} }
/* /*
......
...@@ -4478,6 +4478,14 @@ static const struct dmi_system_id fwbug_list[] __initconst = { ...@@ -4478,6 +4478,14 @@ static const struct dmi_system_id fwbug_list[] __initconst = {
DMI_MATCH(DMI_PRODUCT_NAME, "20UH"), DMI_MATCH(DMI_PRODUCT_NAME, "20UH"),
} }
}, },
{
.ident = "T14s Gen1 AMD",
.driver_data = &quirk_s2idle_bug,
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "20UJ"),
}
},
{ {
.ident = "P14s Gen1 AMD", .ident = "P14s Gen1 AMD",
.driver_data = &quirk_s2idle_bug, .driver_data = &quirk_s2idle_bug,
......
Markdown is supported
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