Re: [PATCH] HID: nintendo: register input device after capabilities are set

Jiri Kosina <[email protected]>
Newsgroups gmane.linux.kernel.input,gmane.linux.kernel,gmane.linux.kernel.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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.