Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1ff6522 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

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: default avatarJens Axboe <jens.axboe@oracle.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 18240904
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);