OSDN Git Service

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)
commit1bcad8e510b27ad843315ab2c27ccf459e3acded
treee6728c0defae4e27ab7e91bb55a9919b5c54b597
parent71d69e82f4168713afd89804d6e5f52d0e3848a2
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: a40cd7ef22fb ("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