提交 ab5f3404 编写于 作者: G Guenter Roeck 提交者: Jiri Kosina

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: 2af16c1f ("HID: nintendo: add nintendo switch controller driver")
Cc: Daniel J. Ogorchock <djogorchock@gmail.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Reviewed-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 12ffcd75
...@@ -1585,6 +1585,7 @@ static const unsigned int joycon_button_inputs_r[] = { ...@@ -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. */ /* We report joy-con d-pad inputs as buttons and pro controller as a hat. */
static const unsigned int joycon_dpad_inputs_jc[] = { static const unsigned int joycon_dpad_inputs_jc[] = {
BTN_DPAD_UP, BTN_DPAD_DOWN, BTN_DPAD_LEFT, BTN_DPAD_RIGHT, 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) static int joycon_input_create(struct joycon_ctlr *ctlr)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册