Skip to content

Commit

Permalink
usb: gadget: dummy_hcd: don't assign ->desc on error case
Browse files Browse the repository at this point in the history
If the stream check fails then we leave ep->desc assigend but we return
with an error code. The caller assumes the endpoint is not enabled
(which is the case) but it can not enable it again due to this
assigment.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Sebastian Andrzej Siewior authored and Felipe Balbi committed Feb 9, 2012
1 parent d11519a commit 3cf0ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/dummy_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ static int dummy_enable(struct usb_ep *_ep,
}

_ep->maxpacket = max;
ep->desc = desc;
if (usb_ss_max_streams(_ep->comp_desc)) {
if (!usb_endpoint_xfer_bulk(desc)) {
dev_err(udc_dev(dum), "Can't enable stream support on "
Expand All @@ -523,6 +522,7 @@ static int dummy_enable(struct usb_ep *_ep,
}
ep->stream_en = 1;
}
ep->desc = desc;

dev_dbg(udc_dev(dum), "enabled %s (ep%d%s-%s) maxpacket %d stream %s\n",
_ep->name,
Expand Down

0 comments on commit 3cf0ad0

Please sign in to comment.