diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-01-25 11:51:19 +0100 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-02-09 09:53:53 +0200 |
commit | 3cf0ad02e42a91e85ffe9bd67422dd266531d3ec (patch) | |
tree | b31c5635d9a6b07c1e57a5d92a6ab536e2f7bd4a /drivers/usb/gadget/dummy_hcd.c | |
parent | d11519adc214c243ec606f186316f2667b677694 (diff) | |
download | linux-3cf0ad02e42a91e85ffe9bd67422dd266531d3ec.tar.bz2 |
usb: gadget: dummy_hcd: don't assign ->desc on error case
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>
Diffstat (limited to 'drivers/usb/gadget/dummy_hcd.c')
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 67573e5f2a18..9170a4c7ced4 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c @@ -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 " @@ -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, |