From: Jiri Kosina Date: Tue, 15 Sep 2009 09:59:49 +0000 (+0200) Subject: HID: fix non-atomic allocation in hid_input_report X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=d1ff65226c5afe55f9af38a439058f41b71e114f;p=deliverable%2Flinux.git 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 Signed-off-by: Jiri Kosina --- 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 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);