mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-25 21:54:06 +08:00
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>
This commit is contained in:
parent
1824090496
commit
d1ff65226c
@ -1089,8 +1089,7 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE,
|
buf = kmalloc(sizeof(char) * HID_DEBUG_BUFSIZE, GFP_ATOMIC);
|
||||||
interrupt ? GFP_ATOMIC : GFP_KERNEL);
|
|
||||||
|
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
report = hid_get_report(report_enum, data);
|
report = hid_get_report(report_enum, data);
|
||||||
|
Loading…
Reference in New Issue
Block a user