[patch 05/45] usb gadget: fix fsl_usb2_udc potential OOPS

From: Greg KH
Date: Thu Feb 07 2008 - 15:53:14 EST



2.6.24-stable review patch. If anyone has any objections, please let us know.

------------------
From: Li Yang <leoli@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/usb/gadget/fsl_usb2_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- 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
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;
}

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/