[PATCH 39/44] Fix an endless loop in hid-core.c if device has empty reports

From: Vojtech Pavlik
Date: Tue Mar 16 2004 - 11:51:50 EST


You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/input

===================================================================

ChangeSet@xxxxxxxxxxxx, 2004-03-10 09:02:48+01:00, davidm@xxxxxxxxxx
input: Avoid an endless loop in hid-core.c, if a device has some
empty reports.


hid-input.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)

===================================================================

diff -Nru a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- a/drivers/usb/input/hid-input.c Tue Mar 16 13:17:41 2004
+++ b/drivers/usb/input/hid-input.c Tue Mar 16 13:17:41 2004
@@ -569,8 +569,10 @@
while (list != &report_enum->report_list) {
report = (struct hid_report *) list;

- if (!report->maxfield)
+ if (!report->maxfield) {
+ list = list->next;
continue;
+ }

if (!hidinput) {
hidinput = kmalloc(sizeof(*hidinput), GFP_KERNEL);

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