usb: gadget: f_phonet: unlock in error case
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 5 Aug 2011 20:14:46 +0000 (22:14 +0200)
committerFelipe Balbi <balbi@ti.com>
Fri, 12 Aug 2011 09:03:15 +0000 (12:03 +0300)
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_phonet.c

index 8f8d3f6..8f3eab1 100644 (file)
@@ -434,6 +434,7 @@ static int pn_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
                            config_ep_by_speed(gadget, f, fp->out_ep)) {
                                fp->in_ep->desc = NULL;
                                fp->out_ep->desc = NULL;
+                               spin_unlock(&port->lock);
                                return -EINVAL;
                        }
                        usb_ep_enable(fp->out_ep);