Re: [PATCH] HID: nintendo: register input device after capabilities are set
From: Jiri Kosina
Date: Mon Aug 03 2026 - 14:41:24 EST
On Thu, 30 Jul 2026, Jiangshan Yi wrote:
> input_register_device() exposes the device to userspace immediately.
> In joycon_input_create() it was called before joycon_config_rumble()
> configures the FF_RUMBLE capability and the memless force-feedback
> device, so a concurrent EVIOCSFF could dereference a NULL dev->ff.
>
> Registering early also means the initial udev event lacks button and
> axis information, which can make input managers ignore the device.
>
> Move input_register_device() to the end of joycon_input_create(), after
> all capabilities, the IMU input device and the force-feedback callbacks
> have been configured.
>
> Fixes: 2af16c1f846b ("HID: nintendo: add nintendo switch controller driver")
> Reported-by: sashiko-bot@xxxxxxxxxx
> Closes: https://sashiko.dev/#/patchset/20260730031927.25444-1-yijiangshan@xxxxxxxxxx?part=1
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Jiangshan Yi <yijiangshan@xxxxxxxxxx>
Applied, thanks.
--
Jiri Kosina
SUSE Labs