Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d0d3f22 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 10a55a58
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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) {