aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-core.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index c49aaa21e1a7..86cb2c47e9ea 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1091,10 +1091,8 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
1091 1091
1092 buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC); 1092 buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC);
1093 1093
1094 if (!buf) { 1094 if (!buf)
1095 report = hid_get_report(report_enum, data);
1096 goto nomem; 1095 goto nomem;
1097 }
1098 1096
1099 /* dump the report */ 1097 /* dump the report */
1100 snprintf(buf, HID_DEBUG_BUFSIZE - 1, 1098 snprintf(buf, HID_DEBUG_BUFSIZE - 1,
@@ -1107,17 +1105,14 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
1107 hid_debug_event(hid, buf); 1105 hid_debug_event(hid, buf);
1108 } 1106 }
1109 hid_debug_event(hid, "\n"); 1107 hid_debug_event(hid, "\n");
1108 kfree(buf);
1110 1109
1110nomem:
1111 report = hid_get_report(report_enum, data); 1111 report = hid_get_report(report_enum, data);
1112 1112
1113 if (!report) { 1113 if (!report)
1114 kfree(buf);
1115 return -1; 1114 return -1;
1116 }
1117
1118 kfree(buf);
1119 1115
1120nomem:
1121 if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) { 1116 if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
1122 ret = hdrv->raw_event(hid, report, data, size); 1117 ret = hdrv->raw_event(hid, report, data, size);
1123 if (ret != 0) 1118 if (ret != 0)