[PATCH 1/2] platform/asus: asus-armoury: Initialize retval in armoury_has_devstate()
From: Gustaf Bergqvist
Date: Sat Dec 05 2026 - 16:07:09 EST
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@xxxxxxxxx>
---
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