diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-02-10 18:58:59 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-17 14:58:59 +0100 |
commit | 5318251744b2c8a288f91f4e53ed69f2a01d6412 (patch) | |
tree | 48fe1594feac12afa0832b271460ad58b0596afc /drivers/hid/i2c-hid | |
parent | HID: wiimote: replace hid_output_raw_report with hid_hw_output_report for out... (diff) | |
download | linux-5318251744b2c8a288f91f4e53ed69f2a01d6412.tar.xz linux-5318251744b2c8a288f91f4e53ed69f2a01d6412.zip |
HID: core: check parameters when sending/receiving data from the device
It is better to check them soon enough before triggering any kernel panic.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c index 5308656eec2e..1a955317d05f 100644 --- a/drivers/hid/i2c-hid/i2c-hid.c +++ b/drivers/hid/i2c-hid/i2c-hid.c @@ -276,7 +276,7 @@ static int i2c_hid_set_or_send_report(struct i2c_client *client, u8 reportType, u16 outputRegister = le16_to_cpu(ihid->hdesc.wOutputRegister); u16 maxOutputLength = le16_to_cpu(ihid->hdesc.wMaxOutputLength); - /* hidraw already checked that data_len < HID_MAX_BUFFER_SIZE */ + /* hid_hw_* already checked that data_len < HID_MAX_BUFFER_SIZE */ u16 size = 2 /* size */ + (reportID ? 1 : 0) /* reportID */ + data_len /* buf */; |