Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp544818pxj; Thu, 20 May 2021 15:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4VwPniKUA9D1o34/yH3pvS3NCNbjZmDQsPpJD2h/jAKk8RV/InW/VkalIkBpepQRMIwXg X-Received: by 2002:a92:bf09:: with SMTP id z9mr7892095ilh.32.1621551053735; Thu, 20 May 2021 15:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621551053; cv=none; d=google.com; s=arc-20160816; b=E85WATFKDzxjkpXX2WslgcMth1QjwoGZsbWGk05wPyRyky7UXrE4NE5VcwAtyEC3Ck IjTQeDR+nPv+T7BiLIt5XWO1zsoQZTZfW7qexS30aU6yy5qNFi/BMuylxa9KwdYH91t3 4rWwFOCa2I+WSApPft/kjkpbVcucutx5zQa/YWRjvFilis+krdgbTf+fbu8qzgrS2T2d lIkbay+uA/R5Bkv8pXM2a6sfba8thzmJAIMIlWZrfOH7e+7bsLuOSfs9iTZOKBzgmdF9 KyPhFjWiHRxvadgUtJKFV7fOn5pMSukKqVqb5g66DRSz0hfL9Ev8NpHi+LEH2CCEgajG tNsQ== 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=28akzX7r+LzahAkPJX1tOgk5pwuNyJuir0HZTPdkk5c=; b=qJzA2En4hYBZ2Ke4odGpiU/t7gqVutdmy1hoxZMemkroTyu71sxTHmErQ3yqa/n2wy /oYg+pZw5iR9WzgT08YxnnnTwOBKQpNyxNe5Cl8RmBdvwx9RswPLoiHUsuxU7k+ZrG7n o25bfWUNn/t2oXvu8BpIBbs22+Oxd5tDaxa2HqiI40TQt5HOSLVUz2415i7FvBfPkWOk hWp70/ODeeHfwn0FKkVJr4Cap8j4AGbd0AHxHlwu9i4dOu6qeTyRrLfyhOXvWJXsBTmG Y/jRH1u6z1SagYa7VGL07IDN8rzpZYLULDQ/uenOwvSnlxVzkXI6K/mwJInWKzH3L5Tt hHnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aqoIQ4xR; 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 g5si3808229ilq.106.2021.05.20.15.50.41; Thu, 20 May 2021 15:50:53 -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=aqoIQ4xR; 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 S236462AbhETLNK (ORCPT + 99 others); Thu, 20 May 2021 07:13:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:49512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239248AbhETKwz (ORCPT ); Thu, 20 May 2021 06:52:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 806DB61404; Thu, 20 May 2021 10:00:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504840; bh=uy3xaIeNdD5r8adhSdQ7+dPo37KVWtOH3gwnu1EkGac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aqoIQ4xRnWrSq4xrC1+/8DTntiOGnHORQTIEQO6SZ7ve7omiLzyR6vvsEFeTPVJWI OgGlQUgQ3sS54xFzLW59TvMSPtVy3nFSWqMAtyGcXBalcI7YDQsAQ5CY4pp2h4C62w NMTuzuKqnuI4d/VnrQy98uz1BpAEaGbI+Ku8QcRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabian Vogt , Sasha Levin Subject: [PATCH 4.9 103/240] fotg210-udc: Remove a dubious condition leading to fotg210_done Date: Thu, 20 May 2021 11:21:35 +0200 Message-Id: <20210520092112.147893903@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 1eda6fc750c1..d0a9ce7d0635 100644 --- a/drivers/usb/gadget/udc/fotg210-udc.c +++ b/drivers/usb/gadget/udc/fotg210-udc.c @@ -385,8 +385,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