]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: think-lmi: Fix issues with duplicate attributes
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 22 Jun 2021 20:07:54 +0000 (15:07 -0500)
committerHans de Goede <hdegoede@redhat.com>
Mon, 28 Jun 2021 09:34:44 +0000 (11:34 +0200)
commit396281136f72578ae7e17c5a00864cb52c3263cc
treee6728c0defae4e27ab7e91bb55a9919b5c54b597
parent88d09585b19c71961191516c017541c83df96ce4
platform/x86: think-lmi: Fix issues with duplicate attributes

On an AMD based Lenovo T14, I find that the module doesn't work at
all, and instead has a traceback with messages like:

```
sysfs: cannot create duplicate filename '/devices/virtual/firmware-attributes/thinklmi/attributes/Reserved'
```

Duplicate and reserved values showing up appear to be a firmware bug,
but they shouldn't make the driver explode.  So catch them and skip
them.

Fixes: c00cb91dc8a6 ("platform/x86: think-lmi: Add WMI interface support on Lenovo platforms")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20210622200755.12379-2-mario.limonciello@amd.com
[hdegoede@redhat.com: Add missing kfree(tlmi_priv.setting[i])]
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/think-lmi.c