diff options
author | Jiri Kosina <jkosina@suse.cz> | 2009-09-15 05:59:49 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-09-15 06:31:06 -0400 |
commit | d1ff65226c5afe55f9af38a439058f41b71e114f (patch) | |
tree | 4ab64bcce3e1cc0ffdd38419fde74c7817e64aba /drivers/hid | |
parent | 18240904960a39e582ced8ba8ececb10b8c22dd3 (diff) |
HID: fix non-atomic allocation in hid_input_report
'interrupt' variable can't be used to safely determine whether
we are running in atomic context or not, as we might be called from
during control transfer completion through hid_ctrl() in atomic
context with interrupt == 0.
Reported-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 342b7d36d7bb..ca9bb26c2076 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1089,8 +1089,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i | |||
1089 | return -1; | 1089 | return -1; |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, | 1092 | buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC); |
1093 | interrupt ? GFP_ATOMIC : GFP_KERNEL); | ||
1094 | 1093 | ||
1095 | if (!buf) { | 1094 | if (!buf) { |
1096 | report = hid_get_report(report_enum, data); | 1095 | report = hid_get_report(report_enum, data); |