From 400bf75612f3606a18eb736167f2d4909bbeb3ee Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Tue, 12 Jul 2022 15:17:05 -0700 Subject: [PATCH] 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: af1003c28be7d ("HID: nintendo: add nintendo switch controller driver") Cc: Daniel J. Ogorchock Signed-off-by: Guenter Roeck Reviewed-by: Dmitry Torokhov Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina --- drivers/hid/hid-nintendo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c index dcd0f16de7b51..55ede76ab3e4f 100644 --- a/drivers/hid/hid-nintendo.c +++ b/drivers/hid/hid-nintendo.c @@ -1585,6 +1585,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) -- 2.39.5