Skip to content

Commit

Permalink
usb gadget: fix fsl_usb2_udc potential OOPS
Browse files Browse the repository at this point in the history
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

Cc: stable <stable@kernel.org>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Li Yang authored and Greg Kroah-Hartman committed Feb 1, 2008
1 parent 3004e53 commit 2336a98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/fsl_usb2_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 2336a98

Please sign in to comment.