aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-01-31 10:51:47 -0500
committerJiri Kosina <jkosina@suse.cz>2013-01-31 10:51:47 -0500
commit7e41576247b782a21c05f7ea8a78a6db119ba789 (patch)
treeae913df79a900dc357f6ffe6855d62feabde8bdb
parent090800c2a3f746572ef142e2d5404922a599e841 (diff)
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: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-steelseries.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-steelseries.c b/drivers/hid/hid-steelseries.c
index 365bc9ef1e79..2ed995cda44a 100644
--- a/drivers/hid/hid-steelseries.c
+++ b/drivers/hid/hid-steelseries.c
@@ -23,7 +23,8 @@
23#define SRWS1_NUMBER_LEDS 15 23#define SRWS1_NUMBER_LEDS 15
24struct steelseries_srws1_data { 24struct steelseries_srws1_data {
25 __u16 led_state; 25 __u16 led_state;
26 struct led_classdev *led[SRWS1_NUMBER_LEDS]; 26 /* the last element is used for setting all leds simultaneously */
27 struct led_classdev *led[SRWS1_NUMBER_LEDS + 1];
27}; 28};
28#endif 29#endif
29 30