patch "usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in" added to usb-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
Quoted 1 line
From
6d4f268fa132742fe96dad22307c68d237356d88Mon Sep 17 00:00:00 2001
From: Jia-Ju Bai <[email protected]>
Date: Sat, 1 Sep 2018 17:23:47 +0800
Subject: usb: host: u132-hcd: Fix a sleep-in-atomic-context bug in
u132_get_frame()
i_usX2Y_subs_startup in usbusx2yaudio.c is a completion handler function for the USB driver. So it should not sleep, but it is can sleep according to the function call paths (from bottom to top) in Linux-4.16.
[FUNC] msleepdrivers/usb/host/u132-hcd.c, 2558:
msleep in u132_get_framedrivers/usb/core/hcd.c, 2231:
[FUNC_PTR]u132_get_frame in usb_hcd_get_frame_numberdrivers/usb/core/usb.c, 822:
usb_hcd_get_frame_number in usb_get_current_frame_numbersound/usb/usx2y/usbusx2yaudio.c, 303:
usb_get_current_frame_number in i_usX2Y_urb_completesound/usb/usx2y/usbusx2yaudio.c, 366:
i_usX2Y_urb_complete in i_usX2Y_subs_startup
Note that [FUNC_PTR] means a function pointer call is used.
To fix this bug, msleep() is replaced with mdelay().
This bug is found by my static analysis tool DSAC.
--- drivers/usb/host/u132-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/u132-hcd.c +1 -1
@@ -2555,7 +2555,7 @@ static int u132_get_frame(struct usb_hcd *hcd) }else {int frame =0 ;dev_err (&u132->platform_dev->dev,"TODO: u132_get_frame\n" ); -msleep (100 ); +mdelay (100 );return frame; } }
Signature · 1 line
2.18.0