Re: [PATCH] HID: lenovo-go: Fix reset_tx_dongle sysfs attribute to be write-only
From: Jiri Kosina
Date: Fri Nov 27 2026 - 03:11:30 EST
On Thu, 19 Nov 2026, Ian Rogers wrote:
> reset_tx_dongle is defined with LEGO_DEVICE_ATTR_RO(), whereas all other
> FEATURE_RESET_GAMEPAD attributes in hid-lenovo-go.c (reset_mcu,
> reset_left, and reset_right) use LEGO_DEVICE_ATTR_WO().
>
> Because feature_status_show() has no case for FEATURE_RESET_GAMEPAD
> (which is only handled in feature_status_store()), exposing tx_dongle's
> reset attribute as read-only makes reading it always fail with -EINVAL
> while preventing userspace from writing to it to reset the TX dongle.
>
> Change reset_tx_dongle to LEGO_DEVICE_ATTR_WO().
>
> Found by enabling Clang's -Wswitch-enum on an x86_64 allyesconfig build,
> with AI coding assistant help to audit the warning and prepare the fix.
> Build-tested with Clang; not runtime-tested on Lenovo Legion Go hardware.
>
> Fixes: 82cd9bc866e1 ("HID: hid-lenovo-go: Add Feature Status Attributes")
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
Applied, thanks.
--
Jiri Kosina
SUSE Labs