提交 3cf0ad02 编写于 作者: S Sebastian Andrzej Siewior 提交者: Felipe Balbi

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: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 d11519ad
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册