mtd: mtdpart: disallow reading OOB past the end of the partition
[firefly-linux-kernel-4.4.55.git] / drivers / hid / hid-ortek.c
index aa9a960f73a413f59ded643eadbd5a1d77d81601..2e79716dca31e424243e6d6ca4d7dba78e4e0702 100644 (file)
 
 #include "hid-ids.h"
 
-static void ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
-               unsigned int rsize)
+static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+               unsigned int *rsize)
 {
-       if (rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
+       if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
                dev_info(&hdev->dev, "Fixing up Ortek WKB-2000 "
                                "report descriptor.\n");
                rdesc[55] = 0x92;
        }
+       return rdesc;
 }
 
 static const struct hid_device_id ortek_devices[] = {