Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2680171pxj; Mon, 31 May 2021 08:06:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKu2TIj2Vk3DsT2eOZDjwLr+1/MvtLFdVla9D7HdLocOYCas/qLuk3Kh/wn1XFx/zam2eW X-Received: by 2002:a05:6402:40c:: with SMTP id q12mr25623974edv.0.1622473609788; Mon, 31 May 2021 08:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473609; cv=none; d=google.com; s=arc-20160816; b=jp3K3OvuoP0Lsx97mGzp5uMuCF69QB2xpD5/SdJ6aufB98/5Q2xRvQPOpS1FOAGPGZ vzBWMwappFsdLzjTeego1Ah6OKv6zfO2hyorIBjSA65xOAx/OaB9upLnidLKo7eaWd/4 pCJ3oCjzebnmWAdG7uZicPPyxdPYrDm5bq5i1pNNcNKL2AisI8ACxi8knZTFTtne6KTL c2mjgFc5pL8XYxTlyRaYHRMNIgRHNUqqtfwPwXJG/HoMuC3e791pJWJzjNyGx71AONfy GqaxLCOPSPvHwJZAByHxxupEfzHX9F6YwpHstJ2sffhQRllHDipqYV/aJpPjpE9xakbP NGcQ== 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=SBl4CYAvz/OMDymLfSiQxBlq2Im+gjOf9egzBlSYU3Y=; b=tMH0DcNZj9VaHtOW6ZYSmzPAqj9IPsbZEPfJoV8VVSSzqhUz9dKh/+CkbtvZYk7lN+ +nzgVOJHX1nfVAiSZzRBb8R9AVY2mkk2CFYPpBxFeEy8rpUs4/n7JwYKwNzIq1/HGf6U M82yuE8szoZ0MMtT3CA6CDVOU3TKqQRSeumY99UDFJEfKiM35JK0an+0g77ETznCj6B4 kCd/7PvbHB4udghAWq3bPuC2NH9DAWtMIOVO/+GGR1Y3V8I1Ussp+2rSkwkj02LW8/Xv SInDwPuLMTqDPCuDc8SozoSm7DK2qlLT8BrqlNJuqLwK/FLbhU6+Z86/aGmvDnrJgYIo XWug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bv6idWJm; 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 hs26si11348629ejc.307.2021.05.31.08.06.26; Mon, 31 May 2021 08:06:49 -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=Bv6idWJm; 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 S232937AbhEaPHK (ORCPT + 99 others); Mon, 31 May 2021 11:07:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:40830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbhEaOIj (ORCPT ); Mon, 31 May 2021 10:08:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 82FB261972; Mon, 31 May 2021 13:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468397; bh=GNSRhjP034A1cqNo3fUo6lD4GG7Y1g5LL65ZeabSdO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bv6idWJmQ8Hhc5R7htV9S7/bwM+/p0oGiG9Z8KN2SJoi74vE5rCjUpMLvsV6MfvfE rSLIPgUt1EDpuzf5WNVnA6iGEaWcP20brMKeiUwgEL7rxQ43mLGS1t+kT/ZQXHse3i h5xZx4Foobw9PE7PAS5rCArIN94NpwVfEPWNqKHY= 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.10 226/252] staging: emxx_udc: fix loop in _nbu2ss_nuke() Date: Mon, 31 May 2021 15:14:51 +0200 Message-Id: <20210531130705.677981327@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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 a30b4f5b199b..3897f8e8f5e0 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2062,7 +2062,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); @@ -2074,7 +2074,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