Re: [PATCH 1/3] platform/asus: asus-wmi: Fix NULL deref and integer handling in asus_wmi_evaluate_method_buf()
From: bartu alev
Date: Wed Dec 02 2026 - 09:52:40 EST
On 12/2/26 5:40 AM, Denis Benato wrote:
> Hi and thanks for improving this code! I leave my review below.
>
>
> This code, after applying the patch reads as this:
>
> if obj is null and no memory is allocated go to deallocate memory of obj.
>
> I understand that you are preparing for patch 2 and the __free conversion
> here... but probably converting it into __free right away would have been
> better.
>
> You can still split it up, but patches need to have coherent code, if you
> really think the dual patch is the way to go rename out_free into
> asus_wmi_evaluate_method_err and move it below the kfree and
> that way the will be coherent again.
|Hi Denis, thanks for the review! Good point, jumping to out_free when
obj is NULL reads oddly. Patch 1/3 is meant for -stable (back to v5.17,
where cleanup.h and the -Wdeclaration-after-statement drop from 6.5 do
not exist yet, so 6.1 LTS would fail to build with __free()), and patch
2/3 is the -next cleanup. I did spell that out in the cover letter,
though I know u rarely get read :-) Even cleaner than moving the label
below kfree(): since no cleanup is needed when obj is NULL, if (!obj)
can log and return -ENODATA directly (matching the ACPI_FAILURE check
right above it). That removes the goto entirely from 1/3 and keeps 2/3
from touching those lines again. also see Ilpo suggestion|