Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

HID: usbhid: fix deadlock in hid_post_reset()

You can build a USB device that includes a HID component
and a storage or UAS component. The components can be reset
only together. That means that hid_pre_reset() and hid_post_reset()
are in the block IO error handling. Hence no memory allocation
used in them may do block IO because the IO can deadlock
on the mutex held while resetting a device and calling the
interface drivers.
Use GFP_NOIO for all allocations in them.

Fixes: dc3c78e434690 ("HID: usbhid: Check HID report descriptor contents after device reset")
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>

authored by

Oliver Neukum and committed by
Jiri Kosina
8df2c1b4 1f95a6cd

+1 -1
+1 -1
drivers/hid/usbhid/hid-core.c
··· 1552 1552 * configuration descriptors passed, we already know that 1553 1553 * the size of the HID report descriptor has not changed. 1554 1554 */ 1555 - rdesc = kmalloc(hid->dev_rsize, GFP_KERNEL); 1555 + rdesc = kmalloc(hid->dev_rsize, GFP_NOIO); 1556 1556 if (!rdesc) 1557 1557 return -ENOMEM; 1558 1558