summaryrefslogtreecommitdiff
path: root/drivers/usb/class/cdc-wdm.c
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2018-09-01 11:12:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-05 15:48:40 +0300
commit6e22e3af7bb3a7b9dc53cb4687659f6e63fca427 (patch)
treefc60e292ccb57a85d6dc205b2f55c80abbfe7d38 /drivers/usb/class/cdc-wdm.c
parentbc8acc214d3f1cafebcbcd101a695bbac716595d (diff)
downloadlinux-6e22e3af7bb3a7b9dc53cb4687659f6e63fca427.tar.xz
usb: cdc-wdm: Fix a sleep-in-atomic-context bug in service_outstanding_interrupt()
wdm_in_callback() is a completion handler function for the USB driver. So it should not sleep. But it calls service_outstanding_interrupt(), which calls usb_submit_urb() with GFP_KERNEL. To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC. This bug is found by my static analysis tool DSAC. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class/cdc-wdm.c')
-rw-r--r--drivers/usb/class/cdc-wdm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index bec581fb7c63..656d247819c9 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -460,7 +460,7 @@ static int service_outstanding_interrupt(struct wdm_device *desc)
set_bit(WDM_RESPONDING, &desc->flags);
spin_unlock_irq(&desc->iuspin);
- rv = usb_submit_urb(desc->response, GFP_KERNEL);
+ rv = usb_submit_urb(desc->response, GFP_ATOMIC);
spin_lock_irq(&desc->iuspin);
if (rv) {
dev_err(&desc->intf->dev,