HID: nintendo: Add missing array termination
Subsystems (2)
PATCH 1/1 HID: nintendo: Add missing array termination
joycon_dpad_inputs_jc[] is unterminated. This may result in odd warnings such as
input: input_set_capability: invalid code 3077588140 for type 1
or in kernel crashes in nintendo_hid_probe(). Terminate the array to fix the problem.
--- drivers/hid/hid-nintendo.c | 1 + 1 file changed, 1 insertion(+)
drivers/hid/hid-nintendo.c +1 -0
@@ -1586,6 +1586,7 @@ static const unsigned int joycon_button_inputs_r[] = {/* We report joy-con d-pad inputs as buttons and pro controller as a hat. */ static const unsigned int joycon_dpad_inputs_jc[] = {BTN_DPAD_UP ,BTN_DPAD_DOWN ,BTN_DPAD_LEFT ,BTN_DPAD_RIGHT , +0 /* 0 signals end of array */ };static int joycon_input_create (struct joycon_ctlr *ctlr)
Signature · 1 line
2.35.1
Quoted 11 lines · Guenter Roeck
joycon_dpad_inputs_jc[] is unterminated. This may result in odd warnings such as
input:
input_set_capability: invalid code 3077588140 for type 1or in kernel crashes in
nintendo_hid_probe(). Terminate the array to fix the problem.Fixes 2af16c1f846bd ("HID: nintendo: add nintendo switch controller driver")Cc Daniel J. Ogorchock <[email protected]>Signed-off-by Guenter Roeck <[email protected]>
I'd recommend tagging stable on this one.
Quoted 19 lines
--- drivers/hid/hid-nintendo.c | 1 + 1 file changed, 1 insertion(+)drivers/hid/hid-nintendo.c +1
-0@@ -1586,6 +1586,7 @@ static const unsigned int joycon_button_inputs_r[] = {/* We report joy-con d-pad inputs as buttons and pro controller as a hat. */ static const unsigned int joycon_dpad_inputs_jc[] = {BTN_DPAD_UP ,BTN_DPAD_DOWN ,BTN_DPAD_LEFT ,BTN_DPAD_RIGHT , +0 /* 0 signals end of array */ };static int joycon_input_create (struct joycon_ctlr *ctlr)Signature · 1 line
2.35.1
Thanks.
Signature · 1 line
Dmitry
Jiri Kosina
maintainerQuoted 9 lines · Dmitry Torokhov
Quoted 8 lines · Guenter Roeck
joycon_dpad_inputs_jc[] is unterminated. This may result in odd warnings such as
input:
input_set_capability: invalid code 3077588140 for type 1or in kernel crashes in
nintendo_hid_probe(). Terminate the array to fix the problem.
Quoted 7 lines
Quoted 3 lines
Fixes 2af16c1f846bd ("HID: nintendo: add nintendo switch controller driver")Cc Daniel J. Ogorchock <[email protected]>Signed-off-by Guenter Roeck <[email protected]>Reviewed-by Dmitry Torokhov <[email protected]>I'd recommend tagging stable on this one.
I did so and applied, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs