Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2628049pxj; Mon, 31 May 2021 06:56:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHPLGyh2w+7jxLyUp+ix5KF36iVPsybC0c+86zs56pH9XeMnVcHmY+69pdt+TPwAlBe6Aj X-Received: by 2002:a5e:8a42:: with SMTP id o2mr16694856iom.144.1622469361896; Mon, 31 May 2021 06:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622469361; cv=none; d=google.com; s=arc-20160816; b=QDvtQ26Q+mw0u0gS8Brw7udOdUoK6J4hMiQTZqIZ3kVcB7D+steLSYSPxlXiy5k4Nc nHlvXeSmaOMyNYjJYh5jZ4wT5vpITGhnTqfZTOn1nfZHZds4NhYjVBwvJPrCFOYl2vRT hvrOLJ5uXJvtKURQyes9ikJ1FAxpt+OdGP8W00BOG5OunCb6VBmM+XyHRsV1JjH/z1js 55wutWUsBx17KlaLz7jiVk1YTweIxph+4XztzF1aoXP9ZF/V08omYf4+6mI3vYdN3if9 8jcjh2kU5Wi4XHPl6DaIM97HQ3/0tIzBtTdy9yyIDHX1S+HtOEUPVxkHaHYCP5LSJf4k m5cA== 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=wgQjaXxSKUOJ0fMt21iV1xxY0uuGHKuxF7vbD7jeReY=; b=vPbzOS3hs9emgOeLo/m00Fe0/JdFQELaAMhkFsMOeDGzzUop1FfoVctqHZcgtqWLcr Q7V+67KhGY2obcFMGZ+wSxBfHhzc4eS5iRGgogHwbl4LYPSYm1YWM63PChnk2hj8y9YA 0DKWF7Dm4xlhrcUfltQJ9KENcvz0gHMwyO7TV/TIH+32RxUpMcDdrpwY/2QmfL0zsXaO wgITHWSOAPxyNusnobtwdWNlXpXz2wj6pvUhY1Pg+yu5cr2YhOT+6+XT8vxzSjE1nz3n oaijvCmdS+8GzAGA57D9kTWNOz47Ux45vhjH+S90L1vFA+H0WHFe2/bNzN8pgEdw8U2r gPug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="HD/Mfgm4"; 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 g12si11811694ila.56.2021.05.31.06.55.49; Mon, 31 May 2021 06:56:01 -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="HD/Mfgm4"; 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 S232277AbhEaN4b (ORCPT + 99 others); Mon, 31 May 2021 09:56:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:40214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232221AbhEaNgY (ORCPT ); Mon, 31 May 2021 09:36:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F7286144D; Mon, 31 May 2021 13:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467545; bh=0ehsmwxMcJ5M3eodCYeo9WXhDYbu9W5dnK3tTJEgvjw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HD/Mfgm4VtEok4YAe+9rcMkqv0hsyrH87zUHkk2gGCwKBb0N5pecXdJ8KVGrbRrzU dnIWHWSYzUAKY2X8Ydj41sWzxcfHUgCmg0o2f3mhzm+3hWNhCLjCp2s2bS2wytNvA2 bayuiByO5miwKEIZrlxbgwftGRPaQGJs5Vqhexf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sasha Levin Subject: [PATCH 4.19 104/116] staging: emxx_udc: fix loop in _nbu2ss_nuke() Date: Mon, 31 May 2021 15:14:40 +0200 Message-Id: <20210531130643.655092357@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@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 3e51476a7045..d2cb2bd6d913 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2148,7 +2148,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); @@ -2160,7 +2160,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