mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gustaf Bergqvist <gurra.bergqvist@gmail.com>
To: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Corentin Chary" <corentin.chary@gmail.com>,
	"Luke D. Jones" <luke@ljones.dev>,
	"Denis Benato" <denis.benato@linux.dev>
Cc: Armandas Kvietkus <armundunelis@gmail.com>,
	Gustaf Bergqvist <gurra.bergqvist@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] platform/asus: asus-armoury: Initialize retval in armoury_has_devstate()
Date: Sat,  5 Dec 2026 22:06:53 +0100	[thread overview]
Message-ID: <20261205210655.231747-1-gurra.bergqvist@gmail.com> (raw)

armoury_has_devstate() prints retval with pr_debug() right after calling
asus_wmi_evaluate_method(). When the ACPI evaluation fails,
asus_wmi_evaluate_method3() returns -EIO without writing *retval, so the
debug message prints uninitialized stack data.

The return value is not affected, since status is checked before retval
is used. Only the debug output is wrong.

Initialize retval to 0.

This issue was found and the fix written with the help of an AI coding
assistant (Claude Code), during review of the following patch.

Fixes: f99eb098090e ("platform/x86: asus-armoury: move existing tunings to asus-armoury module")
Signed-off-by: Gustaf Bergqvist <gurra.bergqvist@gmail.com>
---
 drivers/platform/asus/asus-armoury.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/asus/asus-armoury.c b/drivers/platform/asus/asus-armoury.c
index a9926c94eea4..721121982cc5 100644
--- a/drivers/platform/asus/asus-armoury.c
+++ b/drivers/platform/asus/asus-armoury.c
@@ -139,7 +139,7 @@ static bool asus_bios_requires_reboot(struct kobj_attribute *attr)
  */
 static bool armoury_has_devstate(u32 dev_id)
 {
-	u32 retval;
+	u32 retval = 0;
 	int status;
 
 	status = asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS, dev_id, 0, &retval);
-- 
2.56.1


             reply	other threads:[~2026-12-05 21:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05 21:06 Gustaf Bergqvist [this message]
2026-12-05 21:06 ` [PATCH 2/2] platform/asus: asus-armoury: Don't warn about power limits without tunables Gustaf Bergqvist

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=20261205210655.231747-1-gurra.bergqvist@gmail.com \
    --to=gurra.bergqvist@gmail.com \
    --cc=armundunelis@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 \
    /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®