Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2751742pxj; Mon, 31 May 2021 09:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzezhn7+ZvFOGQyzhIyGPtq2U1M84lWH5PP8q73fq8XCIT+QrpD1vUd5lqq2Dpx3GrxxwHU X-Received: by 2002:a92:dacc:: with SMTP id o12mr8323884ilq.196.1622479825201; Mon, 31 May 2021 09:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622479825; cv=none; d=google.com; s=arc-20160816; b=NeGVxPsr4T7D9f+P1KbQwszbIWlnA/cJpWRVpqFjv0Rcub/HqaP4sdWxx0UHpQMWg/ pYU+MQ4NA8zvbFPJyhs+zwKGIiXoccCoZCJO6kUzgs+uy1RGH/e6tsv7LBd9VJcf1XqR HuOT/nR+y+N7re4up6sD4M5+txFmlIMzBEa1ECgY9ZiHy1EJjBJOGJARYr6oOb2BwCwl HLQHC9BzPmYa4lI2LzrIxGEED2KQehiyhmFXgjTaz95D/R3/Ze7PaKBo/PDKnMS1PL+R ljia+Npecd18BuiNM4vqpjW40iaKCLwpzs6o1Ob1gBRPKFkZc8HeMy84mDIn1IM3KKDT OCCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YAZNz/wLGS6BE+Ng/EVdQdVo1Co1FogiWWT1muXNrEw=; b=NRR74AdfqgriIhrpk4jqhCkDbOU2XpX8wZzvQnGCs1alCSQw7xiMLv+ayYXw38iM5L Bn+tL35jwqH6VjMM5eKQu5ZOkBL8ruStF6BkG9wxHec3epXnPjdRRzZQqOYPKRfPHlDj Z09dz4Zm0puKahu1MI5+DhdPlV7upw93TR+2lA5vlo8vv2iQgTwFRAk5qMBzFY+sjwNt IOWzpIO289+DO6MJtbDcd1a62k2ee0N4nQWLu7BeYvDT6kmHfKEAi6j4Kuj+kUq/WSrt C+MVacQu5JFsUN+yyRkaLjwlFzP4LzZ6PF2H1Q8MKkVyDOrH4VO/bBDckRxETDE2+xTg X5ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wYW0P1rF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si16438906jat.43.2021.05.31.09.50.12; Mon, 31 May 2021 09:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wYW0P1rF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233014AbhEaQuL (ORCPT + 99 others); Mon, 31 May 2021 12:50:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:51032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234084AbhEaO5U (ORCPT ); Mon, 31 May 2021 10:57:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0086561939; Mon, 31 May 2021 14:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469620; bh=YuISmcruBEAixGzhoO6eLY8HJJ4fJupbjUIXhe4O5BM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wYW0P1rF+JMQtFcrI3IIX1YZhf98LXA2vBArEdjN5ysUhYDcoUPCv1FPocGCIxNOa L53UN7qfMZsMuUhz7Dk7zZDDAP2aX+lgwLtyUVY1IFk5VJSxwbpNn00lGKt57IuZY1 kFZVHhrBnIrYegUbMt33Ek0LF3NOHsyDunP+6UUA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sasha Levin Subject: [PATCH 5.12 267/296] staging: emxx_udc: fix loop in _nbu2ss_nuke() Date: Mon, 31 May 2021 15:15:22 +0200 Message-Id: <20210531130712.717176506@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit e0112a7c9e847ada15a631b88e279d547e8f26a7 ] 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 Link: https://lore.kernel.org/r/YKUd0sDyjm/lkJfJ@mwanda Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/emxx_udc/emxx_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index 3536c03ff523..0d50c1e190bf 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2065,7 +2065,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); @@ -2077,7 +2077,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); } -- 2.30.2