Skip to content

Commit

Permalink
usb: dwc3: gadget: don't leave locks held
Browse files Browse the repository at this point in the history
prevent a lock leak by making sure it's disabled
in the error path.

Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Sekhar Nori <[email protected]>
  • Loading branch information
Felipe Balbi authored and nsekhar committed Aug 27, 2015
1 parent 645b7a4 commit 73fe278
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
ret = dwc3_device_reinit(dwc);
if (ret) {
dev_err(dwc->dev, "device reinit failed\n");
spin_unlock_irqrestore(&dwc->lock, flags);
return ret;
}

Expand All @@ -1572,6 +1573,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
ret = dwc3_gadget_restart(dwc);
if (ret) {
dev_err(dwc->dev, "failed to re-init gadget\n");
spin_unlock_irqrestore(&dwc->lock, flags);
return ret;
}

Expand Down

0 comments on commit 73fe278

Please sign in to comment.