[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220815180430.187702863@linuxfoundation.org>
Date: Mon, 15 Aug 2022 19:50:19 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
"Daniel J. Ogorchock" <djogorchock@...il.com>,
Guenter Roeck <linux@...ck-us.net>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Jiri Kosina <jkosina@...e.cz>
Subject: [PATCH 5.18 0020/1095] HID: nintendo: Add missing array termination
From: Guenter Roeck <linux@...ck-us.net>
commit ab5f3404b7762b88403fbddbdda6b1b464bd6cbc upstream.
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 <djogorchock@...il.com>
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: stable@...r.kernel.org
Signed-off-by: Jiri Kosina <jkosina@...e.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/hid/hid-nintendo.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -1586,6 +1586,7 @@ static const unsigned int joycon_button_
/* 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)
Powered by blists - more mailing lists