From nobody Mon Jun 15 19:06:07 2026 Received: from mx9.kaspersky-labs.com (mx9.kaspersky-labs.com [195.122.169.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAD953A383B; Mon, 13 Apr 2026 09:43:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.122.169.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776073382; cv=none; b=khh2lrogRf+7fB90TPgIln61XhMcRGxSKOdsZWy8wlUqj87S2jQENZCyaBuH7HeIyIk29hjb9wGE51tjEa//2GeqLGhdXpjNbVc4wwML/Wd6tFezKzO45Gwgw8gEN1bejzx1gyWLOmU0v5ZmAHY0vsm8CABHMQ/L4q5eoPQdWqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776073382; c=relaxed/simple; bh=vjbVZzxCSA1t9isGeReY/yIpvFirFZEfJlFWah1o0xo=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZVBIGT/5JvoKCxeGq2mTaeAmIcn3wPq5qf6GV/9K+oQ6QF1yj5nbho4i4X7OJLpMBtvWqAWtESiOBKIoKVmgKuCW52t1slhG1hU4kCwro7Y06vE8m8socKdhZkc4SbTojtCsdA8KFL9uqIkGuHu51DpbQ3PcAszE2x3/+TVwzo8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kaspersky.com; spf=pass smtp.mailfrom=kaspersky.com; dkim=pass (2048-bit key) header.d=kaspersky.com header.i=@kaspersky.com header.b=H57422gD; arc=none smtp.client-ip=195.122.169.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kaspersky.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kaspersky.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kaspersky.com header.i=@kaspersky.com header.b="H57422gD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kaspersky.com; s=mail202505; t=1776073379; bh=x4lKBSdZdsxXDAjfnVaREem6d/vq6Wg3horiq03ED18=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=H57422gDyYF89da/DpyAefaZZ3ZhVcjdWx0lmD+YpqIwjoC/acOTU3zK97g22AQyX 5Ai1Z020l/RF/MksdfU9zEzgoj8EswTTHzMiB/iMv7bNG5KrRvMNqaz7PqUKtYL+UD AudhNHPFnmZN/iRDnpJKpgpMU2zTvw3TlhRbv2adDgKxIvjpLIxgXRKG00W0NWkGhD GDvGgrctsRT319SdVVuyJh1SIrg9gu1V7Ze/iKwuW1h72321rUYINefba4pw1yUFBX +pzNZ+9dBIYeO2Y/2scWhRw6h2gxpqKvnsXkNWdY4woUgU+BezOn/nF9ppnWwli3Gw gaOaZ8JoNqL6Q== Received: from relay9.kaspersky-labs.com (localhost [127.0.0.1]) by relay9.kaspersky-labs.com (Postfix) with ESMTP id 1C7418A0705; Mon, 13 Apr 2026 12:42:59 +0300 (MSK) Received: from mail-hq2.kaspersky.com (unknown [91.103.66.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail-hq2.kaspersky.com", Issuer "Kaspersky MailRelays CA G3" (verified OK)) by mailhub9.kaspersky-labs.com (Postfix) with ESMTPS id D3BCD8A061E; Mon, 13 Apr 2026 12:42:58 +0300 (MSK) Received: from chesnokov.avp.ru (10.16.105.7) by HQMAILSRV2.avp.ru (10.64.57.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.37; Mon, 13 Apr 2026 12:42:58 +0300 From: To: CC: , , , Alexander Chesnokov , , Johan Hovold , Yoshihiro Shimoda , Felipe Balbi , , Subject: [PATCH] usb: gadget: udc: renesas_usb3: Fix wrong comparison in usb3_dma_update_status() Date: Mon, 13 Apr 2026 12:42:49 +0300 Message-ID: <20260413094256.47014-1-Alexander.Chesnokov@kaspersky.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HQMAILSRV2.avp.ru (10.64.57.52) To HQMAILSRV2.avp.ru (10.64.57.52) X-KSE-ServerInfo: HQMAILSRV2.avp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.1.1, Database issued on: 04/13/2026 09:19:39 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 202222 [Apr 13 2026] X-KSE-AntiSpam-Info: Version: 6.1.1.22 X-KSE-AntiSpam-Info: Envelope from: Alexander.Chesnokov@kaspersky.com X-KSE-AntiSpam-Info: LuaCore: 98 0.3.98 ca9d2f3beca9ca2a85e178af9d8e97d5fa2c38a3 X-KSE-AntiSpam-Info: {Tracking_cluster_exceptions} X-KSE-AntiSpam-Info: {Tracking_real_kaspersky_domains} X-KSE-AntiSpam-Info: {Tracking_black_eng_exceptions} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: 127.0.0.199:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;kaspersky.com:7.1.1,5.0.1;chesnokov.avp.ru:7.1.1,5.0.1 X-KSE-AntiSpam-Info: {Tracking_white_helo} X-KSE-AntiSpam-Info: FromAlignment: s X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 04/13/2026 09:22:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 4/13/2026 8:25:00 AM X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.1.8310, bases: 2026/04/13 06:49:00 #28394185 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 52 Content-Type: text/plain; charset="utf-8" From: Alexander Chesnokov If the last PRD entry flag is not set, the condition (i + 1) <=20 USB3_DMA_NUM_PRD_ENTRIES is always true on the first iteration when i equals zero, causing the loop to break immediately and only one PRD entry to be processed. Fix the comparison operator from < to >=3D so the loop breaks when the PRD table is exhausted. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 2d4aa21a73ba ("usb: gadget: udc: renesas_usb3: add support for dedic= ated DMAC") Cc: stable@vger.kernel.org Signed-off-by: Alexander Chesnokov --- drivers/usb/gadget/udc/renesas_usb3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc= /renesas_usb3.c index c6f2a09f561d..22404ef40601 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -1410,7 +1410,7 @@ static int usb3_dma_update_status(struct renesas_usb3= _ep *usb3_ep, req->actual +=3D len - remain; =20 if (cur_prd->word1 & USB3_PRD1_E || - (i + 1) < USB3_DMA_NUM_PRD_ENTRIES) + (i + 1) >=3D USB3_DMA_NUM_PRD_ENTRIES) break; =20 cur_prd++; --=20 2.43.0