From: Jiri Kosina <jkosina@suse.cz>
To: Simon Wood <simon@mungewell.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
rosegardener@freeode.co.uk
Subject: Re: [PATCH 1/5] USB: HID: SRW-S1 Gaming Wheel Driver
Date: Thu, 31 Jan 2013 16:54:16 +0100 (CET) [thread overview]
Message-ID: <alpine.LNX.2.00.1301311653090.23853@pobox.suse.cz> (raw)
In-Reply-To: <16fadf665c1103c5f3184d9f4471d415.squirrel@mungewell.org>
On Thu, 31 Jan 2013, simon@mungewell.org wrote:
> > I thought we converged to hid-steelseries name in the end originally?
> >
> > If you agree, I'll change it and apply.
>
> I'd be OK with that,
Thanks. I will also apply this patch on top, otherwise we'll be corrupting
memory in steelseries_srws1_probe() here:
drv_data->led[SRWS1_NUMBER_LEDS] = led;
From: Jiri Kosina <jkosina@suse.cz>
Subject: [PATCH] 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>
---
drivers/hid/hid-steelseries.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/hid/hid-steelseries.c b/drivers/hid/hid-steelseries.c
index 365bc9e..2ed995c 100644
--- a/drivers/hid/hid-steelseries.c
+++ b/drivers/hid/hid-steelseries.c
@@ -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
--
Jiri Kosina
SUSE Labs
next prev parent reply other threads:[~2013-01-31 15:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-25 6:34 [PATCH 1/4] USB: HID: SRW-S1 Gaming Wheel Driver Simon Wood
2013-01-25 6:34 ` [PATCH 2/4] USB: HID: SRW-S1 Add support for dials Simon Wood
2013-01-25 6:34 ` [PATCH 3/4] USB: HID: SRW-S1 Add support for LEDs Simon Wood
2013-01-25 6:34 ` [PATCH 4/4] USB: HID: SRW-S1 Add support controlling all LEDs simultaneously Simon Wood
2013-01-28 15:02 ` Jiri Kosina
2013-01-28 15:24 ` simon
2013-01-28 14:59 ` [PATCH 1/4] USB: HID: SRW-S1 Gaming Wheel Driver Jiri Kosina
2013-01-28 15:38 ` simon
2013-01-28 16:56 ` Jiri Kosina
2013-01-28 17:00 ` simon
2013-01-29 9:57 ` Jiri Kosina
2013-01-31 15:07 ` [PATCH 1/5] " Simon Wood
2013-01-31 15:07 ` [PATCH 2/5] USB: HID: Steelseries SRW-S1 Add support for dials Simon Wood
2013-01-31 15:07 ` [PATCH 3/5] USB: HID: Steelseries SRW-S1 Add support for LEDs Simon Wood
2013-01-31 15:07 ` [PATCH 4/5] USB: HID: Steelseries SRW-S1 Add support controlling all LEDs simultaneously Simon Wood
2013-01-31 15:15 ` [PATCH 1/5] USB: HID: SRW-S1 Gaming Wheel Driver simon
2013-01-31 15:15 ` simon
2013-01-31 15:23 ` Jiri Kosina
2013-01-31 15:36 ` simon
2013-01-31 15:54 ` Jiri Kosina [this message]
2013-01-31 16:15 ` simon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.00.1301311653090.23853@pobox.suse.cz \
--to=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rosegardener@freeode.co.uk \
--cc=simon@mungewell.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.