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>
This commit is contained in:

committed by
Felipe Balbi

parent
391aa852a3
commit
e79cc615a9
@@ -319,10 +319,9 @@ fail:
|
||||
if (f->hs_descriptors)
|
||||
usb_free_descriptors(f->hs_descriptors);
|
||||
|
||||
/* we might as well release our claims on endpoints */
|
||||
if (eem->port.out_ep->desc)
|
||||
if (eem->port.out_ep)
|
||||
eem->port.out_ep->driver_data = NULL;
|
||||
if (eem->port.in_ep->desc)
|
||||
if (eem->port.in_ep)
|
||||
eem->port.in_ep->driver_data = NULL;
|
||||
|
||||
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
|
||||
|
Reference in New Issue
Block a user