diff options
| author | Jiangshan Yi <yijiangshan@kylinos.cn> | 2026-07-30 11:19:27 +0800 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-08-03 19:20:13 +0200 |
| commit | 1f74d3bff6fe04a64e02ab3661d2e0d554565aa6 (patch) | |
| tree | 330ef79e4365e947ec3ede5d338e47a2f884d9a1 /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | bf3e39df3a397fd82967a31d17c4e02c7feab221 (diff) | |
HID: nintendo: stop device IO before hid_hw_stop on probe failure
nintendo_hid_probe() calls hid_device_io_start() before joycon_init()
and joycon_leds_create(). If either fails, the error path jumps to
err_close which calls hid_hw_close()/hid_hw_stop() without first calling
hid_device_io_stop().
hid_hw_stop() does not stop device IO, so hid_input_report() may still
run and access driver data that is being torn down, resulting in a
use-after-free.
Add an err_io_stop label that calls hid_device_io_stop() before
hid_hw_close(), and point the two post-io_start error paths at it.
Fixes: 2af16c1f846b ("HID: nintendo: add nintendo switch controller driver")
Cc: stable@vger.kernel.org
Signed-off-by: Jiangshan Yi <yijiangshan@kylinos.cn>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
