From: Tomasz Pakuła Date: Wed, 13 Aug 2025 20:09:53 +0000 (+0200) Subject: HID: pidff: Treat PID_REQUIRED_REPORTS as count, not max X-Git-Tag: v6.18-rc1~81^2~5^2~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7ad7812fb8c9319a5148b3c8f14b0b0b3d7e015;p=thirdparty%2Fkernel%2Flinux.git HID: pidff: Treat PID_REQUIRED_REPORTS as count, not max It's naming suggests it's a count of the records required by the USB PID standard and this driver. Signed-off-by: Tomasz Pakuła Reviewed-by: Oleg Makarenko Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index 2f9fbe4c52d7..cff79e76c211 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -33,7 +33,7 @@ #define PID_DEVICE_CONTROL 6 #define PID_CREATE_NEW_EFFECT 7 -#define PID_REQUIRED_REPORTS 7 +#define PID_REQUIRED_REPORTS 8 #define PID_SET_ENVELOPE 8 #define PID_SET_CONDITION 9 @@ -1056,7 +1056,7 @@ static int pidff_reports_ok(struct pidff_device *pidff) { int i; - for (i = 0; i <= PID_REQUIRED_REPORTS; i++) { + for (i = 0; i < PID_REQUIRED_REPORTS; i++) { if (!pidff->reports[i]) { hid_dbg(pidff->hid, "%d missing\n", i); return 0;