diff options
-rw-r--r-- | drivers/hid/hid-core.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index da52279de939..a5c7927c9bd2 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -842,7 +842,17 @@ struct hid_report *hid_validate_values(struct hid_device *hid, | |||
842 | * ->numbered being checked, which may not always be the case when | 842 | * ->numbered being checked, which may not always be the case when |
843 | * drivers go to access report values. | 843 | * drivers go to access report values. |
844 | */ | 844 | */ |
845 | report = hid->report_enum[type].report_id_hash[id]; | 845 | if (id == 0) { |
846 | /* | ||
847 | * Validating on id 0 means we should examine the first | ||
848 | * report in the list. | ||
849 | */ | ||
850 | report = list_entry( | ||
851 | hid->report_enum[type].report_list.next, | ||
852 | struct hid_report, list); | ||
853 | } else { | ||
854 | report = hid->report_enum[type].report_id_hash[id]; | ||
855 | } | ||
846 | if (!report) { | 856 | if (!report) { |
847 | hid_err(hid, "missing %s %u\n", hid_report_names[type], id); | 857 | hid_err(hid, "missing %s %u\n", hid_report_names[type], id); |
848 | return NULL; | 858 | return NULL; |