Re: [PATCH] platform/x86: acer-wmi: reject missing gaming WMI results

From: Yousef Alhouseen

Date: Tue Jun 30 2026 - 16:42:56 EST


Thanks, Armin. That interpretation makes sense. I’ll preserve NULL as
the output-ignore case and only reject a missing object when the
caller supplied an output pointer in v2.

On Tue, 30 Jun 2026 22:16:43 +0200, Armin Wolf <W_Armin@xxxxxx> wrote:
> 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@xxxxxxxxx>
> > ---
> > 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;