Skip to content

Commit ab5f340

Browse files
groeckJiri Kosina
authored andcommitted
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. Fixes: 2af16c1 ("HID: nintendo: add nintendo switch controller driver") Cc: Daniel J. Ogorchock <djogorchock@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 12ffcd7 commit ab5f340

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/hid/hid-nintendo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@ static const unsigned int joycon_button_inputs_r[] = {
15851585
/* We report joy-con d-pad inputs as buttons and pro controller as a hat. */
15861586
static const unsigned int joycon_dpad_inputs_jc[] = {
15871587
BTN_DPAD_UP, BTN_DPAD_DOWN, BTN_DPAD_LEFT, BTN_DPAD_RIGHT,
1588+
0 /* 0 signals end of array */
15881589
};
15891590

15901591
static int joycon_input_create(struct joycon_ctlr *ctlr)

0 commit comments

Comments
 (0)