]> Git Repo - linux.git/commitdiff
HID: steelseries: fix out of bound array access
authorJiri Kosina <[email protected]>
Thu, 31 Jan 2013 15:51:47 +0000 (16:51 +0100)
committerJiri Kosina <[email protected]>
Thu, 31 Jan 2013 15:51:47 +0000 (16:51 +0100)
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 <[email protected]>
drivers/hid/hid-steelseries.c

index 365bc9ef1e79222ca926b23f6cb61ced9bf15030..2ed995cda44a8763a11c4c5aba0e69277dfb1069 100644 (file)
@@ -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
 
This page took 0.057012 seconds and 4 git commands to generate.