From: Bartu Alev <bartualev@gmail.com>
To: "Denis Benato" <denis.benato@linux.dev>,
"Corentin Chary" <corentin.chary@gmail.com>,
"Luke D. Jones" <luke@ljones.dev>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] platform/asus: asus-wmi: Use __free(kfree) in asus_wmi_evaluate_method_buf()
Date: Wed, 2 Dec 2026 18:13:51 +0300 [thread overview]
Message-ID: <be0cdea2-c076-4845-9293-178c95b54fcb@gmail.com> (raw)
In-Reply-To: <e15170ea-7eaa-4389-b2c2-f7d47af13999@linux.dev>
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.
>
next prev parent reply other threads:[~2026-12-02 15:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 23:31 [PATCH 0/3] platform/asus: asus-wmi: harden asus_wmi_evaluate_method_buf() Bartu Alev
2026-12-01 23:31 ` [PATCH 1/3] platform/asus: asus-wmi: Fix NULL deref and integer handling in asus_wmi_evaluate_method_buf() Bartu Alev
2026-12-02 2:40 ` Denis Benato
2026-12-02 14:52 ` bartu alev
2026-12-01 23:31 ` [PATCH 2/3] platform/asus: asus-wmi: Use __free(kfree) " Bartu Alev
2026-12-02 2:45 ` Denis Benato
2026-12-02 15:13 ` Bartu Alev [this message]
2026-12-01 23:31 ` [PATCH 3/3] platform/asus: asus-wmi: Document asus_wmi_evaluate_method_buf() Bartu Alev
2026-12-02 2:50 ` Denis Benato
2026-12-02 15:16 ` Bartu Alev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be0cdea2-c076-4845-9293-178c95b54fcb@gmail.com \
--to=bartualev@gmail.com \
--cc=corentin.chary@gmail.com \
--cc=denis.benato@linux.dev \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luke@ljones.dev \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.