You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
usb: musb: Balance list entry in musb_gadget_queue
commit21b5fcdccbupstream. musb_gadget_queue() adds the passed request to musb_ep::req_list. If the endpoint is idle and it is the first request then it invokes musb_queue_resume_work(). If the function returns an error then the error is passed to the caller without any clean-up and the request remains enqueued on the list. If the caller enqueues the request again then the list corrupts. Remove the request from the list on error. Fixes:ea2f35c01d("usb: musb: Fix sleeping function called from invalid context for hdrc glue") Cc: stable <stable@vger.kernel.org> Signed-off-by: Viraj Shah <viraj.shah@linutronix.de> Link: https://lore.kernel.org/r/20211021093644.4734-1-viraj.shah@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2740914312
commit
1309753b78
@@ -1247,9 +1247,11 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
|
||||
status = musb_queue_resume_work(musb,
|
||||
musb_ep_restart_resume_work,
|
||||
request);
|
||||
if (status < 0)
|
||||
if (status < 0) {
|
||||
dev_err(musb->controller, "%s resume work: %i\n",
|
||||
__func__, status);
|
||||
list_del(&request->list);
|
||||
}
|
||||
}
|
||||
|
||||
unlock:
|
||||
|
||||
Reference in New Issue
Block a user