diff options
author | Jiri Kosina <jkosina@suse.cz> | 2009-09-15 11:59:49 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-09-15 12:31:06 +0200 |
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 342b7d36d7b..ca9bb26c207 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 return -1; } - buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, - interrupt ? GFP_ATOMIC : GFP_KERNEL); + buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC); if (!buf) { report = hid_get_report(report_enum, data); |