]> git.itanic.dy.fi Git - linux-stable/commit
HID: keep dev_rdesc unmodified and use it for comparisons
authorKevin Daughtridge <kevin@kdau.com>
Thu, 20 Sep 2012 19:00:32 +0000 (12:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Oct 2012 15:35:54 +0000 (08:35 -0700)
commit5b537939972d4a232136e8cb6eae0ba657b892e4
tree1466dde68e22104cd91dc42b75461d4a50b0c8e2
parent8a5683bdd01bc2408a18cb9759a2a614081b9436
HID: keep dev_rdesc unmodified and use it for comparisons

commit 86e6b77eb7cf9ca2e9c7092b4dfd588f0a3307b6 upstream.

The dev_rdesc member of the hid_device structure is meant to store the original
report descriptor received from the device, but it is currently passed to any
report_fixup method before it is copied to the rdesc member. This patch uses a
temporary buffer to shield dev_rdesc from the side effects of many HID drivers'
report_fixup implementations.

usbhid's hid_post_reset checks the report descriptor currently returned by the
device against a descriptor that may have been modified by a driver's
report_fixup method. That leaves some devices nonfunctional after a resume, with
a "reset_resume error 1" reported. This patch checks the new descriptor against
the unmodified dev_rdesc instead and uses the original, instead of modified,
report size.

BugLink: http://bugs.launchpad.net/bugs/1049623
Signed-off-by: Kevin Daughtridge <kevin@kdau.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-core.c
drivers/hid/usbhid/hid-core.c