Skip to content

Commit e0112a7

Browse files
Dan Carpentergregkh
authored andcommitted
staging: emxx_udc: fix loop in _nbu2ss_nuke()
The _nbu2ss_ep_done() function calls: list_del_init(&req->queue); which means that the loop will never exit. Fixes: ca3d253 ("Staging: emxx_udc: Iterate list using list_for_each_entry") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/YKUd0sDyjm/lkJfJ@mwanda Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d07f6ca commit e0112a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/staging/emxx_udc/emxx_udc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,7 +2064,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc,
20642064
struct nbu2ss_ep *ep,
20652065
int status)
20662066
{
2067-
struct nbu2ss_req *req;
2067+
struct nbu2ss_req *req, *n;
20682068

20692069
/* Endpoint Disable */
20702070
_nbu2ss_epn_exit(udc, ep);
@@ -2076,7 +2076,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc,
20762076
return 0;
20772077

20782078
/* called with irqs blocked */
2079-
list_for_each_entry(req, &ep->queue, queue) {
2079+
list_for_each_entry_safe(req, n, &ep->queue, queue) {
20802080
_nbu2ss_ep_done(ep, req, status);
20812081
}
20822082

0 commit comments

Comments
 (0)