提交 7e415762 编写于 作者: J Jiri Kosina

HID: steelseries: fix out of bound array access

The last field of the driver_data->leds[] array is used to store the
special toggle for setting all leds simultaneously, so we need to allocate
appropriate number of led_classdev pointers.
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 090800c2
......@@ -23,7 +23,8 @@
#define SRWS1_NUMBER_LEDS 15
struct steelseries_srws1_data {
__u16 led_state;
struct led_classdev *led[SRWS1_NUMBER_LEDS];
/* the last element is used for setting all leds simultaneously */
struct led_classdev *led[SRWS1_NUMBER_LEDS + 1];
};
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册