aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Yang <leoli@freescale.com>2008-02-01 15:16:43 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2008-02-08 11:46:21 -0800
commitf3f25f6175790dc79028fd39d0eb3abce5f2222b (patch)
treee7ad56eec226000d9603249bc71a357215337fac
parenta9ceb6ce700eb40d9aff44c2601b51943eea6990 (diff)
usb gadget: fix fsl_usb2_udc potential OOPS
For fsl_usb2_udc driver, ep0 also has a descriptor. Current code is misleading and contains a logical mistake. Here is the patch to fix it. http://bugzilla.kernel.org/show_bug.cgi?id=9595 Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/gadget/fsl_usb2_udc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c
index 038e7d7b4da..d59eb92a847 100644
--- a/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/drivers/usb/gadget/fsl_usb2_udc.c
@@ -776,7 +776,7 @@ fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
VDBG("%s, bad params\n", __FUNCTION__);
return -EINVAL;
}
- if (!_ep || (!ep->desc && ep_index(ep))) {
+ if (unlikely(!_ep || !ep->desc)) {
VDBG("%s, bad ep\n", __FUNCTION__);
return -EINVAL;
}