aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <[email protected]>2022-07-12 15:17:05 -0700
committerJiri Kosina <[email protected]>2022-07-21 13:48:16 +0200
commitab5f3404b7762b88403fbddbdda6b1b464bd6cbc (patch)
tree997422656d567376745469d84d00a3373e1fae8f
parent12ffcd757860ed541f0dbb86bbd0ddac642e2e43 (diff)
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: 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]> Cc: [email protected] Signed-off-by: Jiri Kosina <[email protected]>
-rw-r--r--drivers/hid/hid-nintendo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index dcd0f16de7b5..55ede76ab3e4 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)