diff options
author | Adam Kropelin <akropel1@rochester.rr.com> | 2007-04-11 11:13:13 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-13 13:47:03 -0700 |
commit | 2031c51916f2fd44222715c8b1ba23d5f8ef56f9 (patch) | |
tree | 7ac1f22307ce2c83612facd2d166e67515ef72be /drivers | |
parent | 6beeeb80630839e09763ee7102fb82e48cdb4e3e (diff) |
HID: Do not discard truncated input reports
HID: Do not discard truncated input reports
Truncated reports should not be discarded since it prevents buggy
devices from communicating with userspace.
Prior to the regession introduced in 2.6.20, a shorter-than-expected
report in hid_input_report() was passed thru after having the missing
bytes cleared. This behavior was established over a few patches in the
2.6.early-teens days, including commit
cd6104572bca9e4afe0dcdb8ecd65ef90b01297b.
This patch restores the previous behavior and fixes the regression.
Signed-off-by: Adam Kropelin <akropel1@rochester.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/hid-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 5cb2500128ea..1ecad3ecef2b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -975,7 +975,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i if (size < rsize) { dbg("report %d is too short, (%d < %d)", report->id, size, rsize); - return -1; + memset(data + size, 0, rsize - size); } if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event) |