diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 10 | ||||
-rw-r--r-- | drivers/hid/hid-picolcd.c | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 4c87276c8ddb..71f87b1d71de 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1194,8 +1194,10 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, | |||
1194 | goto out; | 1194 | goto out; |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | for (a = 0; a < report->maxfield; a++) | 1197 | if (hid->claimed != HID_CLAIMED_HIDRAW) { |
1198 | hid_input_field(hid, report->field[a], cdata, interrupt); | 1198 | for (a = 0; a < report->maxfield; a++) |
1199 | hid_input_field(hid, report->field[a], cdata, interrupt); | ||
1200 | } | ||
1199 | 1201 | ||
1200 | if (hid->claimed & HID_CLAIMED_INPUT) | 1202 | if (hid->claimed & HID_CLAIMED_INPUT) |
1201 | hidinput_report_event(hid, report); | 1203 | hidinput_report_event(hid, report); |
@@ -1243,6 +1245,10 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i | |||
1243 | goto unlock; | 1245 | goto unlock; |
1244 | } | 1246 | } |
1245 | 1247 | ||
1248 | /* Avoid unnecessary overhead if debugfs is disabled */ | ||
1249 | if (list_empty(&hid->debug_list)) | ||
1250 | goto nomem; | ||
1251 | |||
1246 | buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC); | 1252 | buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC); |
1247 | 1253 | ||
1248 | if (!buf) | 1254 | if (!buf) |
diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c index 45c3433f7986..3e0a1e5d2ad5 100644 --- a/drivers/hid/hid-picolcd.c +++ b/drivers/hid/hid-picolcd.c | |||
@@ -1846,7 +1846,7 @@ static void picolcd_debug_out_report(struct picolcd_data *data, | |||
1846 | #define BUFF_SZ 256 | 1846 | #define BUFF_SZ 256 |
1847 | 1847 | ||
1848 | /* Avoid unnecessary overhead if debugfs is disabled */ | 1848 | /* Avoid unnecessary overhead if debugfs is disabled */ |
1849 | if (!hdev->debug_events) | 1849 | if (list_empty(&hdev->debug_list)) |
1850 | return; | 1850 | return; |
1851 | 1851 | ||
1852 | buff = kmalloc(BUFF_SZ, GFP_ATOMIC); | 1852 | buff = kmalloc(BUFF_SZ, GFP_ATOMIC); |