aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_ecm.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-10-22 22:15:00 +0200
committerBen Hutchings <ben@decadent.org.uk>2013-01-03 03:32:59 +0000
commit3bda29813bdadfcda3513fb9b0d384534ac27dd7 (patch)
tree2405188fbccc09d18d6515491a69da265858541f /drivers/usb/gadget/f_ecm.c
parentb2b7d3370d2b9ed53c9f8f9e77ae1b017cb8dd4b (diff)
downloadkernel_samsung_smdk4412-3bda29813bdadfcda3513fb9b0d384534ac27dd7.zip
kernel_samsung_smdk4412-3bda29813bdadfcda3513fb9b0d384534ac27dd7.tar.gz
kernel_samsung_smdk4412-3bda29813bdadfcda3513fb9b0d384534ac27dd7.tar.bz2
usb: gadget: network: fix bind() error path
commit e79cc615a9bb44da72c499ccfa2c9c4bbea3aa84 upstream. 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> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
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 11c07cb..72fd355 100644
--- a/drivers/usb/gadget/f_ecm.c
+++ b/drivers/usb/gadget/f_ecm.c
@@ -790,9 +790,9 @@ fail:
/* we might as well release our claims on endpoints */
if (ecm->notify)
ecm->notify->driver_data = NULL;
- if (ecm->port.out_ep->desc)
+ if (ecm->port.out_ep)
ecm->port.out_ep->driver_data = NULL;
- if (ecm->port.in_ep->desc)
+ if (ecm->port.in_ep)
ecm->port.in_ep->driver_data = NULL;
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);