Re: [PATCH 2/3] platform/asus: asus-wmi: Use __free(kfree) in asus_wmi_evaluate_method_buf()
From: Bartu Alev
Date: Wed Dec 02 2026 - 10:14:06 EST
On 12/2/26 5:45 AM, Denis Benato wrote:
> obj was assigned here, you moved it up but I can't see any reason for that,
> in fact moving it up only increase the possibility of an allocation immediately
> freed due to an error (like the return -EIO).
>
> Move the obj __free line here.
__free(kfree) does not allocate anything and is a no-op when
output.pointer is NULL. The reason I placed it before the
ACPI_FAILURE(status) check is an ACPICA quirk in
drivers/acpi/acpica/nsxfeval.c: acpi_evaluate_object() calls
acpi_ut_initialize_buffer() (allocating return_buffer->pointer) before
acpi_ut_copy_iobject_to_eobject(). If copying fails with AE_TYPE or
AE_SUPPORT, acpi_evaluate_object() goes to cleanup_return_object without
freeing return_buffer->pointer, so output.pointer can be non-NULL on an
error return.
That said, if you and Ilpo prefer placing the __free(kfree) declaration
after the ACPI_FAILURE(status) check, i am move it down in v2.
>
> Yeah... I think that this should be patch 1, but Ilpo might have
> a different opinion... At the same time 8 lines changes in two
> patches where half of the first patch gets dropped on the second
> looks like a bit of an overkill to me.
>