mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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, stable@vger.kernel.org
Subject: Re: [PATCH 1/3] platform/asus: asus-wmi: Fix NULL deref and integer handling in asus_wmi_evaluate_method_buf()
Date: Wed, 2 Dec 2026 17:52:29 +0300	[thread overview]
Message-ID: <8c60927c-ba8a-4994-b121-7e259acd5362@gmail.com> (raw)
In-Reply-To: <37360523-462d-42f0-98e0-cf45d4646398@linux.dev>


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|



  reply	other threads:[~2026-12-02 14:52 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 [this message]
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
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=8c60927c-ba8a-4994-b121-7e259acd5362@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 \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®