From nobody Tue Dec 2 02:05:03 2025 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D69F82EB87B for ; Thu, 20 Nov 2025 02:41:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763606490; cv=none; b=m1smmiBeBIPqMJV5zVQ5iJGXqkwEyDubGFkV1OqlawxjcGSKzVJ6Gvl9TOIrdtwfTtjneqKJir9iv97Zy0TDeDegra/IswFpV/BlOaquN3w9rmgHMUwJQlSgihhG39bFUcCF54q8/Q5pZZ999ZsgBQHbM7LmJUAm8cXyJe9VMyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763606490; c=relaxed/simple; bh=jFwNwWdjU6JFz1vlO+bddlmMzNe96JhQtmbtF5Zah2A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CPsWEDHHXuz8ci/OEj/j35r2wcmLMTlUUj1dPjb8TBf83LO3ifDFUxA98lF73o3wsOlxcBhZU0rWiAGfncjtiOWqke9D44gA3nM6MLvr+lERHw+5DmvnNx7O6j5EzI3AkTfzICUqtDZZNZdEsb1zX8TNHpaEn8I/9kgWElx39C8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=LNlyhOn7; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="LNlyhOn7" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763606476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GXKtuN+ygt1gHTstlLD2fqUyrh9LM0SOKM3E9WWFJi0=; b=LNlyhOn7sCoSvgPYUJ10KE74QavcLRS3/07la1jh4iZKtfS0CzcJobdwwH7p7A0Gj7M9LA dXDfEUOdG+m89FqOK1qWYkoFrQkz7XjxBJhjdPFxCT4IGqnZJi0K2ptpHZaLLX8rVycIwh LJhYrPfkCV90++EUTvq618q34bMEHF0= From: Denis Benato To: linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org, "Hans de Goede" , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , "Limonciello, Mario" , "Luke D . Jones" , "Alok Tiwari" , "Derek John Clark" , "Mateusz Schyboll" , porfet828@gmail.com, "Denis Benato" , Dan Carpenter , Denis Benato Subject: [PATCH] platform/x86: asus-armoury: fix mini-led mode show Date: Thu, 20 Nov 2025 03:40:59 +0100 Message-ID: <20251120024059.1341326-1-denis.benato@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Perform the actual check of the mini-led mode against supported modes and d= o not return the first one regardless of the WMI devstate. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/aR1xbxEQyQPEvB9o@stanley.mountain/ Signed-off-by: Denis Benato --- drivers/platform/x86/asus-armoury.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asu= s-armoury.c index d6aba68515e2..c4919f3bf4b2 100644 --- a/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c @@ -373,7 +373,8 @@ static ssize_t mini_led_mode_current_value_show(struct = kobject *kobj, mode =3D FIELD_GET(ASUS_MINI_LED_MODE_MASK, 0); =20 for (i =3D 0; i < mini_led_mode_map_size; i++) - return sysfs_emit(buf, "%u\n", mini_led_mode_map[i]); + if (mode =3D=3D mini_led_mode_map[i]) + return sysfs_emit(buf, "%u\n", i); =20 pr_warn("Unrecognized mini-LED mode: %u", mode); return -EINVAL; --=20 2.52.0