Re: [PATCH] usbhid: call report_fixup before comparing descriptors

From
Kevin Daughtridge <hidden>
Date
2012-09-19 02:21:18
Also in
lkml
Reply to
Henrik Rydberg, 2012-09-18
On 09/18/12 09:16 N.U., Henrik Rydberg wrote:
You can use dev_rdesc here instead.
Hi Henrik. Thanks for the tip. I tried comparing rdesc to hid->dev_rdesc without any report_fixup call, but the problem (device nonfunctional with "reset_resume error 1" message) still occurred. Upon looking at hid_open_report, I noticed that it calls report_fixup on dev_rdesc (pointer copied to "start") before it is kmemdup'd to rdesc. For most HID drivers, the report_fixup method directly modifies and returns the passed structure instead of returning a new pointer, so dev_rdesc is also modified. Assuming that dev_rdesc is supposed to be the unmodified data, I moved the report_fixup call in hid_open_report to after the kmemdup. This combination successfully solves the original problem. I'll submit a new patch version presently that addresses both points.

On 09/18/12 05:00 N.U., Sergei Shtylyov wrote:
Your patch is whitespace damaged, i.e. has all tabs replaced by spaces. Hi Sergei. Thanks for catching that. The munging problem was supposedly fixed in Thunderbird years ago! I guess I'll just mail the new version from the command line.
-Kevin
Thread (4 messages) 4 messages, 3 authors, last reply 2012-09-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help