summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorVijayavardhan Vennapusa <vvreddy@codeaurora.org>2017-02-24 15:09:44 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-02-28 03:17:17 -0800
commit6d0d3f22227ab4b16b077079fc99c0ed09fd4e32 (patch)
tree1f172a602608ac257bb2fefc641d45aad88d616b /drivers/usb/gadget/composite.c
parent10a55a587418b3c37a57b4beae8337432b6ff3c0 (diff)
USB: composite: Release spinlock before WARN()
if WARN() is called under spinlock, it will lead crash due to watchdog timeout. Hence fix it by releasing spinlock before calling WARN(). And also check cdev->config is NULL or not before calling WARN(). Change-Id: Iebd00932b94164e9f40aa6126a2352437b1141ed Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index a53b23789d7a..018f539054fe 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2461,6 +2461,11 @@ void usb_composite_setup_continue(struct usb_composite_dev *cdev)
spin_lock_irqsave(&cdev->lock, flags);
if (cdev->delayed_status == 0) {
+ if (!cdev->config) {
+ spin_unlock_irqrestore(&cdev->lock, flags);
+ return;
+ }
+ spin_unlock_irqrestore(&cdev->lock, flags);
WARN(cdev, "%s: Unexpected call\n", __func__);
} else if (--cdev->delayed_status == 0) {