aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_ecm.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-10-22 16:15:00 -0400
committerFelipe Balbi <balbi@ti.com>2012-10-31 09:04:24 -0400
commite79cc615a9bb44da72c499ccfa2c9c4bbea3aa84 (patch)
tree0b860852814460a151fe7323ae1d31726adbe18f /drivers/usb/gadget/f_ecm.c
parent391aa852a372308c216d8638e57fe8fe560558f2 (diff)
usb: gadget: network: fix bind() error path
I think this is wrong since 72c973dd ("usb: gadget: add usb_endpoint_descriptor to struct usb_ep"). If we fail to allocate an ep or bail out early we shouldn't check for the descriptor which is assigned at ep_enable() time. Cc: Tatyana Brokhman <tlinder@codeaurora.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/f_ecm.c')
-rw-r--r--drivers/usb/gadget/f_ecm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c
index 789242749df5..a158740255ce 100644
--- a/drivers/usb/gadget/f_ecm.c
+++ b/drivers/usb/gadget/f_ecm.c
@@ -809,9 +809,9 @@ fail:
809 /* we might as well release our claims on endpoints */ 809 /* we might as well release our claims on endpoints */
810 if (ecm->notify) 810 if (ecm->notify)
811 ecm->notify->driver_data = NULL; 811 ecm->notify->driver_data = NULL;
812 if (ecm->port.out_ep->desc) 812 if (ecm->port.out_ep)
813 ecm->port.out_ep->driver_data = NULL; 813 ecm->port.out_ep->driver_data = NULL;
814 if (ecm->port.in_ep->desc) 814 if (ecm->port.in_ep)
815 ecm->port.in_ep->driver_data = NULL; 815 ecm->port.in_ep->driver_data = NULL;
816 816
817 ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); 817 ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);