Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8da7d1bae512aee155ef02f7ab1266358842e1fd Commit: 8da7d1bae512aee155ef02f7ab1266358842e1fd Parent: e0f2e3a06be513352cb4955313ed7e55909acd84 Author: Adam Kropelin <[EMAIL PROTECTED]> AuthorDate: Thu Apr 5 16:06:30 2007 +0200 Committer: Jiri Kosina <[EMAIL PROTECTED]> CommitDate: Thu Apr 5 16:06:30 2007 +0200
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 <[EMAIL PROTECTED]> Signed-off-by: Jiri Kosina <[EMAIL PROTECTED]> --- 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 67f3347..1cca32f 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -969,7 +969,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) - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html