Files
linux/drivers
Jia-Ju Bai cb1083af77 usb: gadget: udc: fotg210-udc: Fix a sleep-in-atomic-context bug in fotg210_get_status()
[ Upstream commit 2337a77c1c ]

The driver may sleep in an interrupt handler.
The function call path (from bottom to top) in Linux-4.17 is:

[FUNC] fotg210_ep_queue(GFP_KERNEL)
drivers/usb/gadget/udc/fotg210-udc.c, 744:
	fotg210_ep_queue in fotg210_get_status
drivers/usb/gadget/udc/fotg210-udc.c, 768:
	fotg210_get_status in fotg210_setup_packet
drivers/usb/gadget/udc/fotg210-udc.c, 949:
	fotg210_setup_packet in fotg210_irq (interrupt handler)

To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
If possible, spin_unlock() and spin_lock() around fotg210_ep_queue()
can be also removed.

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-11-25 09:53:23 +01:00
..
2019-10-05 12:30:36 +02:00
2018-12-21 14:11:37 +01:00
2019-05-14 19:19:34 +02:00
2019-10-07 18:53:16 +02:00
2019-11-12 19:15:40 +01:00
2018-12-21 14:11:36 +01:00
2018-11-13 11:17:02 -08:00
2018-11-27 16:09:41 +01:00
2018-10-03 17:01:42 -07:00
2019-09-16 08:19:34 +02:00
2019-11-25 09:53:14 +01:00
2019-05-31 06:48:15 -07:00
2019-10-17 13:42:10 -07:00