diff options
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8be458b79b2c..0cddcaa3fe7f 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1032,7 +1032,7 @@ static struct hid_report *hid_get_report(struct hid_report_enum *report_enum, | |||
1032 | return report; | 1032 | return report; |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | 1035 | int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, |
1036 | int interrupt) | 1036 | int interrupt) |
1037 | { | 1037 | { |
1038 | struct hid_report_enum *report_enum = hid->report_enum + type; | 1038 | struct hid_report_enum *report_enum = hid->report_enum + type; |
@@ -1040,10 +1040,11 @@ void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | |||
1040 | unsigned int a; | 1040 | unsigned int a; |
1041 | int rsize, csize = size; | 1041 | int rsize, csize = size; |
1042 | u8 *cdata = data; | 1042 | u8 *cdata = data; |
1043 | int ret = 0; | ||
1043 | 1044 | ||
1044 | report = hid_get_report(report_enum, data); | 1045 | report = hid_get_report(report_enum, data); |
1045 | if (!report) | 1046 | if (!report) |
1046 | return; | 1047 | goto out; |
1047 | 1048 | ||
1048 | if (report_enum->numbered) { | 1049 | if (report_enum->numbered) { |
1049 | cdata++; | 1050 | cdata++; |
@@ -1063,14 +1064,19 @@ void hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | |||
1063 | 1064 | ||
1064 | if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event) | 1065 | if ((hid->claimed & HID_CLAIMED_HIDDEV) && hid->hiddev_report_event) |
1065 | hid->hiddev_report_event(hid, report); | 1066 | hid->hiddev_report_event(hid, report); |
1066 | if (hid->claimed & HID_CLAIMED_HIDRAW) | 1067 | if (hid->claimed & HID_CLAIMED_HIDRAW) { |
1067 | hidraw_report_event(hid, data, size); | 1068 | ret = hidraw_report_event(hid, data, size); |
1069 | if (ret) | ||
1070 | goto out; | ||
1071 | } | ||
1068 | 1072 | ||
1069 | for (a = 0; a < report->maxfield; a++) | 1073 | for (a = 0; a < report->maxfield; a++) |
1070 | hid_input_field(hid, report->field[a], cdata, interrupt); | 1074 | hid_input_field(hid, report->field[a], cdata, interrupt); |
1071 | 1075 | ||
1072 | if (hid->claimed & HID_CLAIMED_INPUT) | 1076 | if (hid->claimed & HID_CLAIMED_INPUT) |
1073 | hidinput_report_event(hid, report); | 1077 | hidinput_report_event(hid, report); |
1078 | out: | ||
1079 | return ret; | ||
1074 | } | 1080 | } |
1075 | EXPORT_SYMBOL_GPL(hid_report_raw_event); | 1081 | EXPORT_SYMBOL_GPL(hid_report_raw_event); |
1076 | 1082 | ||
@@ -1147,7 +1153,7 @@ nomem: | |||
1147 | } | 1153 | } |
1148 | } | 1154 | } |
1149 | 1155 | ||
1150 | hid_report_raw_event(hid, type, data, size, interrupt); | 1156 | ret = hid_report_raw_event(hid, type, data, size, interrupt); |
1151 | 1157 | ||
1152 | unlock: | 1158 | unlock: |
1153 | up(&hid->driver_lock); | 1159 | up(&hid->driver_lock); |