mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86: acer-wmi: reject missing gaming WMI results
@ 2026-06-30 10:50 Yousef Alhouseen
  2026-06-30 20:16 ` Armin Wolf
  2026-06-30 20:46 ` [PATCH v2] " Yousef Alhouseen
  0 siblings, 2 replies; 6+ messages in thread
From: Yousef Alhouseen @ 2026-06-30 10:50 UTC (permalink / raw)
  To: Lee, Chun-Yi
  Cc: Hans de Goede, Ilpo Järvinen, platform-driver-x86,
	linux-kernel, 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.

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;
-- 
2.54.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-01 16:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-30 10:50 [PATCH] platform/x86: acer-wmi: reject missing gaming WMI results Yousef Alhouseen
2026-06-30 20:16 ` Armin Wolf
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome