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

Commit 2b4f008e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Prevent race between composite_setup & USB disconnect"

parents 2d7d9fc4 9af7e6cb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2320,6 +2320,11 @@ static int dwc3_gadget_vbus_session(struct usb_gadget *_gadget, int is_active)
	is_active = !!is_active;

	dbg_event(0xFF, "VbusSess", is_active);

	disable_irq(dwc->irq);

	flush_work(&dwc->bh_work);

	spin_lock_irqsave(&dwc->lock, flags);

	/* Mark that the vbus was powered */
@@ -2351,6 +2356,8 @@ static int dwc3_gadget_vbus_session(struct usb_gadget *_gadget, int is_active)
	}

	spin_unlock_irqrestore(&dwc->lock, flags);

	enable_irq(dwc->irq);
	return 0;
}