mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: Yousef Alhouseen <alhouseenyousef@gmail.com>,
	"Lee, Chun-Yi" <jlee@suse.com>
Cc: "Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: acer-wmi: reject missing gaming WMI results
Date: Tue, 30 Jun 2026 22:16:43 +0200	[thread overview]
Message-ID: <706918ff-7ec8-4288-9fc6-8ad759feee23@gmx.de> (raw)
In-Reply-To: <20260630105033.53967-1-alhouseenyousef@gmail.com>

Am 30.06.26 um 12:50 schrieb Yousef Alhouseen:

> WMI_gaming_execute_u32_u64() returns success when firmware supplies
> no output object, leaving the caller output untouched.  Gaming getters
> then inspect an uninitialized result value.
>
> Return -ENOMSG for a missing object and -EINVAL for a missing output
> pointer, matching the existing malformed-result handling.

Good catch, but i suspect that the original intention for checking "out"
was to enable callers to ignore any output values by passing "out" as NULL.

Please only return an error if obj is NULL _and_ out is not NULL.

Thanks,
Armin Wolf

> Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
> ---
>   drivers/platform/x86/acer-wmi.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index e0eaaefb13d0..81d354c80cd2 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -1581,7 +1581,11 @@ static int WMI_gaming_execute_u32_u64(u32 method_id, u32 in, u64 *out)
>   		return -EIO;
>   
>   	obj = result.pointer;
> -	if (obj && out) {
> +	if (!obj) {
> +		ret = -ENOMSG;
> +	} else if (!out) {
> +		ret = -EINVAL;
> +	} else {
>   		switch (obj->type) {
>   		case ACPI_TYPE_INTEGER:
>   			*out = obj->integer.value;

  reply	other threads:[~2026-06-30 20:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 10:50 Yousef Alhouseen
2026-06-30 20:16 ` Armin Wolf [this message]
2026-06-30 20:38   ` Yousef Alhouseen
2026-06-30 20:46 ` [PATCH v2] " Yousef Alhouseen
2026-07-01  8:51   ` Ilpo Järvinen
2026-07-01 16:42   ` [PATCH v3] " Yousef Alhouseen
2026-07-21 17:16     ` Ilpo Järvinen

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=706918ff-7ec8-4288-9fc6-8ad759feee23@gmx.de \
    --to=w_armin@gmx.de \
    --cc=alhouseenyousef@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jlee@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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®