Re: [PATCH] HID: nintendo: register input device after capabilities are set
Jiri Kosina <[email protected]> Mon, 3 Aug 2026 20:34:18 +0200 (CEST)
| Newsgroups | org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
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: [email protected]
> Closes: https://sashiko.dev/#/patchset/[email protected]?part=1
> Cc: [email protected]
> Signed-off-by: Jiangshan Yi <[email protected]>
Applied, thanks.
--
Jiri Kosina
SUSE Labs