[PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws

Kurt Borja posted 3 patches 3 months, 1 week ago
There is a newer version of this series
drivers/platform/x86/lenovo/think-lmi.c | 92 ++++++++++++---------------------
1 file changed, 33 insertions(+), 59 deletions(-)
[PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws
Posted by Kurt Borja 3 months, 1 week ago
Hi all,

First patch is a prerequisite in order to avoid NULL pointer
dereferences in error paths. Then two fixes follow.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
Kurt Borja (3):
      platform/x86: think-lmi: Create ksets consecutively
      platform/x86: think-lmi: Fix kobject cleanup
      platform/x86: think-lmi: Fix sysfs group cleanup

 drivers/platform/x86/lenovo/think-lmi.c | 92 ++++++++++++---------------------
 1 file changed, 33 insertions(+), 59 deletions(-)
---
base-commit: 73f0f2b52c5ea67b3140b23f58d8079d158839c8
change-id: 20250628-lmi-fix-98143b10d9fd
-- 
 ~ Kurt
Re: [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws
Posted by Mark Pearson 3 months, 1 week ago
Thanks Kurt,

On Sat, Jun 28, 2025, at 2:00 PM, Kurt Borja wrote:
> Hi all,
>
> First patch is a prerequisite in order to avoid NULL pointer
> dereferences in error paths. Then two fixes follow.
>
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> Kurt Borja (3):
>       platform/x86: think-lmi: Create ksets consecutively
>       platform/x86: think-lmi: Fix kobject cleanup
>       platform/x86: think-lmi: Fix sysfs group cleanup
>
>  drivers/platform/x86/lenovo/think-lmi.c | 92 ++++++++++++---------------------
>  1 file changed, 33 insertions(+), 59 deletions(-)
> ---
> base-commit: 73f0f2b52c5ea67b3140b23f58d8079d158839c8
> change-id: 20250628-lmi-fix-98143b10d9fd
> -- 
>  ~ Kurt

The patches all look good to me:
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

The only caveat is I tried a build and system won't boot. I don't think it's related to your changes, but it means I've not been able to actually test them to confirm all working normally. I'll dig a bit more and figure out what is going on.

Mark
Re: [PATCH 0/3] platform/x86: think-lmi: Fix resource cleanup flaws
Posted by Kurt Borja 3 months, 1 week ago
On Sat Jun 28, 2025 at 4:30 PM -03, Mark Pearson wrote:
> Thanks Kurt,
>
> On Sat, Jun 28, 2025, at 2:00 PM, Kurt Borja wrote:
>> Hi all,
>>
>> First patch is a prerequisite in order to avoid NULL pointer
>> dereferences in error paths. Then two fixes follow.
>>
>> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
>> ---
>> Kurt Borja (3):
>>       platform/x86: think-lmi: Create ksets consecutively
>>       platform/x86: think-lmi: Fix kobject cleanup
>>       platform/x86: think-lmi: Fix sysfs group cleanup
>>
>>  drivers/platform/x86/lenovo/think-lmi.c | 92 ++++++++++++---------------------
>>  1 file changed, 33 insertions(+), 59 deletions(-)
>> ---
>> base-commit: 73f0f2b52c5ea67b3140b23f58d8079d158839c8
>> change-id: 20250628-lmi-fix-98143b10d9fd
>> -- 
>>  ~ Kurt
>
> The patches all look good to me:
> Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Thanks!

>
> The only caveat is I tried a build and system won't boot. I don't think it's related to your changes, but it means I've not been able to actually test them to confirm all working normally. I'll dig a bit more and figure out what is going on.

Let me know if the problem persists only when the patches are applied.

>
> Mark

PD: After reading the kobject code I realized kobject_del() call is
completely optional. I'll send a v2 without it.


-- 
 ~ Kurt