summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-05-19 17:16:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-20 11:40:15 +0200
commitede4ac7b67eb27482ae5fe8f8173554eb45ced66 (patch)
treec287238a75c86eabfb54550569dff531124590bc
parent9a032e3f7e045236ad529b7669257cd57b4f9dc0 (diff)
downloadlinux-ede4ac7b67eb27482ae5fe8f8173554eb45ced66.tar.gz
linux-ede4ac7b67eb27482ae5fe8f8173554eb45ced66.tar.bz2
linux-ede4ac7b67eb27482ae5fe8f8173554eb45ced66.zip
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: ca3d253eb967 ("Staging: emxx_udc: Iterate list using list_for_each_entry") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YKUd0sDyjm/lkJfJ@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/emxx_udc/emxx_udc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index 741147a4f0fe..ecc5c9da9027 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -2064,7 +2064,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc,
struct nbu2ss_ep *ep,
int status)
{
- struct nbu2ss_req *req;
+ struct nbu2ss_req *req, *n;
/* Endpoint Disable */
_nbu2ss_epn_exit(udc, ep);
@@ -2076,7 +2076,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc,
return 0;
/* called with irqs blocked */
- list_for_each_entry(req, &ep->queue, queue) {
+ list_for_each_entry_safe(req, n, &ep->queue, queue) {
_nbu2ss_ep_done(ep, req, status);
}