Re: [PATCH v2] HID: leave dev_rdesc unmodified and use it for comparisons

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 19-09-2012 6:36, Kevin Daughtridge wrote:

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 moves
the kmemdup to before, not after, the report_fixup call, keeping dev_rdesc
unchanged.

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.

BugLink:http://bugs.launchpad.net/bugs/1049623
Signed-off-by: Kevin Daughtridge<kevin@xxxxxxxx>

Need space before the email. I've checked your original mail, it's not my Thunderbird this time (which does this kind of damage while quoting).

---
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -775,12 +775,14 @@ int hid_open_report(struct hid_device *d
          return -ENODEV;
      size = device->dev_rsize;

+    start = kmemdup(start, size, GFP_KERNEL);
+    if (start == NULL)
+        return -ENOMEM;
+
      if (device->driver->report_fixup)
          start = device->driver->report_fixup(device, start, &size);

-    device->rdesc = kmemdup(start, size, GFP_KERNEL);
-    if (device->rdesc == NULL)
-        return -ENOMEM;
+    device->rdesc = start;
      device->rsize = size;

      parser = vzalloc(sizeof(struct hid_parser));

It still seems like the patch is whitespace damaged, but in another way: to every line satrting with space, another spece was added.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux