diff options
author | Jiri Kosina <jkosina@suse.cz> | 2008-09-17 13:41:58 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-10-14 17:51:00 -0400 |
commit | 2b107d629dc0c35de606bb7b010b829cd247a93a (patch) | |
tree | c287d509c0a16a2c7d30b00d413a8a3b81e5188a /drivers | |
parent | d92870ddd248e8c2562a8c4047885d3ad221ece7 (diff) |
HID: fix incorrent length condition in hidraw_write()
The bound check on the buffer length
if (count > HID_MIN_BUFFER_SIZE)
is of course incorrent, the proper check is
if (count > HID_MAX_BUFFER_SIZE)
Fix it.
Reported-by: Jerry Ryle <jerry@mindtribe.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/hidraw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 4be240e74d4f..497e0d1dd3c3 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
@@ -113,7 +113,7 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t | |||
113 | if (!dev->hid_output_raw_report) | 113 | if (!dev->hid_output_raw_report) |
114 | return -ENODEV; | 114 | return -ENODEV; |
115 | 115 | ||
116 | if (count > HID_MIN_BUFFER_SIZE) { | 116 | if (count > HID_MAX_BUFFER_SIZE) { |
117 | printk(KERN_WARNING "hidraw: pid %d passed too large report\n", | 117 | printk(KERN_WARNING "hidraw: pid %d passed too large report\n", |
118 | task_pid_nr(current)); | 118 | task_pid_nr(current)); |
119 | return -EINVAL; | 119 | return -EINVAL; |