Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4607393pxj; Wed, 12 May 2021 09:08:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD8FMYmP/a2TctllpKe+vA3hswFBsVc1N05ErVZOzAydOPYOXx56irbIt1a5JB7isS+k3p X-Received: by 2002:adf:a519:: with SMTP id i25mr4750299wrb.312.1620835714496; Wed, 12 May 2021 09:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835714; cv=none; d=google.com; s=arc-20160816; b=Iakq3js7Nzic2Q63ijlAaLR01Wmq3K7mvifi4b0LHqTBntJxCXcpiq3WbWO8kRxjnV iu9SNzhAGYIf07L3vWMuV2odtgInm/X0VKA1iUdyW6QQ3Gm7xec8R9LZQwQV2uFxzXyY WeYXr7AnxzExo693Z2U8/jq84wEn0WVxEGk66e0w0v3DSCaFGYsFl2q4ven6TCjg+O8P 01FPLal71W+c+Wdsu5ATN/HhWOpPUTSOW7aRQn3ghsqlzaBvoAHfc05WtoraAFxe1i+0 u6J1qW2/kwx3nXf+NpJi7O1opQogG9+2UfOlAc8rbjKuaEbgcvrrLLW1NSOFQsw9Jglw dQSw== 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=LcjO9y0z4A85QR8TR7IQ1OxWi+JxILQ8BQbclI767ho=; b=A5o+lM4VS2zUOiRy10no3hOcdRH6zutgKAXcbjksHHDwEk0/sHIdB1VJp/UGl2xVA5 M5RMZ9b0/JzTJgLn0k+Yl78VjyO/I7WcQJIH//4BhojwNqiM53xSelO/FQcYzaJAXf6/ 1L+OVdDnsDt8KriXWoV3AHjs3kbHXkao9RiKqeI4uGXpz6BR2NoM4L7HLc8v1c1i27oI UoxU4EK2zoSu0ZtPodKP4TkHf+CdH4YbaY+oEhOEskzg4QZc9n4pIz1GQICAIGNONhzX COeKzPxAaAlu3X9Epk0yZz+ZLYDOZkZ7wpYWAvqiEftX5hLYRnBOYX8Qr+tNxsjEZtrt SeRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hkjqLbVn; 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 q18si305056ejs.509.2021.05.12.09.08.09; Wed, 12 May 2021 09:08:34 -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=hkjqLbVn; 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 S238677AbhELQF4 (ORCPT + 99 others); Wed, 12 May 2021 12:05:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:60504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234001AbhELPYV (ORCPT ); Wed, 12 May 2021 11:24:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 25B32619B9; Wed, 12 May 2021 15:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832192; bh=DF8prHhm7BdjJr3JuvxXGbq5KxsOC0UJ246nObn0pFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hkjqLbVnpFx6LX9ipqlMtdmkhK4Fgs8piZ1cDeUFscaCxRSvW0p15oOuQJSvMyRYb vy1TmyeWi4jFNi4lPhrP3bs1E1eR2rkazNftfEWk+BeSvt28WSD0kfaOapx9XoJPxz m3foQHQoSaQpwzH1yV71Zc4JFcSdbCFMCfYzNwHo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabian Vogt , Sasha Levin Subject: [PATCH 5.10 178/530] fotg210-udc: Remove a dubious condition leading to fotg210_done Date: Wed, 12 May 2021 16:44:48 +0200 Message-Id: <20210512144825.682136847@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@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: Fabian Vogt [ Upstream commit c7f755b243494d6043aadcd9a2989cb157958b95 ] When the EP0 IN request was not completed but less than a packet sent, it would complete the request successfully. That doesn't make sense and can't really happen as fotg210_start_dma always sends min(length, maxpkt) bytes. Fixes: b84a8dee23fd ("usb: gadget: add Faraday fotg210_udc driver") Signed-off-by: Fabian Vogt Link: https://lore.kernel.org/r/20210324141115.9384-4-fabian@ritter-vogt.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/fotg210-udc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/fotg210-udc.c b/drivers/usb/gadget/udc/fotg210-udc.c index 345827cf1b64..a3ad93bfd256 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -379,8 +379,7 @@ static void fotg210_ep0_queue(struct fotg210_ep *ep, } if (ep->dir_in) { /* if IN */ fotg210_start_dma(ep, req); - if ((req->req.length == req->req.actual) || - (req->req.actual < ep->ep.maxpacket)) + if (req->req.length == req->req.actual) fotg210_done(ep, req, 0); } else { /* OUT */ u32 value = ioread32(ep->fotg210->reg + FOTG210_DMISGR0); -- 2.30.2