From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 BEF4A261B9B for ; Thu, 26 Feb 2026 12:54:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772110482; cv=none; b=oxWBJZ6mE+fKhDhb1hHVzWcUD9z1oFSuxlzoiZ5KuS9exSyhyWRytoedBPWhj8IzT6yCQGb+h73G1K0dDGxKaMykRcYyDpBCSM7V5DFFPVRtbD5e+ATDRqfVbrHFOlfxsjjxOvF6QM3QWa1G9Bkl7uZhK4MwZj00ATZ2TaxeKD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772110482; c=relaxed/simple; bh=qdhExau4EdWGIrrxTmyAuVoUQu4TlAE+DRYwGKYCARk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pMWZZIn0I8PE65Tg7636kiHDqHi9wK6p2skFDQuMbvS7iIGcKt+hU32sc0EXMJXamaudussb6ouoEYZvbgkLMSFgXAbamrUFzJbRUKoZ5b1969MMUk/csJ93oDm9vV8lHpEZtSds1ruyRB5zda/+GwQPcjhLu6IsJdyc82x4pIc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=iOVNx7HJ; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="iOVNx7HJ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 584054E41220; Thu, 26 Feb 2026 12:54:39 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2E1375FDEB; Thu, 26 Feb 2026 12:54:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 25FAB10369384; Thu, 26 Feb 2026 13:54:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1772110478; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=ncpr492b2CcbH6ioPHy268/fHOhZ+5Q//ciIJhH68JQ=; b=iOVNx7HJsBac1U70F9kaWqjbsR7WjGPcjKwcrtnFeo81/qSSJNFZ9JUEyGGyNxlu5tiCnc TL6c8A2gPo22IkzAaIyD/BxLXnQU72SKd1MqtMFczVO9khBFoxtZmiAHbGgkeBcH/yuv+e YBENVYYbdL4MrQhhSIk7G30I+U410jr6QUIyCynwVEkSfxGmrv2icBSULEBlJ7ecldT0du 5qQS1wHYPejxFIsbsS6XahLW70+G2cSyOKeoIneQ57LzD6NhkHYrGspikKYQOw3YeiFeDb tEn1l4uCaJ53UT9LBnVui6Vqe+vfweQSVXkVuiQJ8Jbepq+Wq6s3A5L4OxrYoQ== From: Romain Gantois To: Arnd Bergmann , Greg Kroah-Hartman , Andi Shyti , Wolfram Sang , Linus Walleij , Felix Gu Cc: linux-kernel@vger.kernel.org, Felix Gu Subject: Re: [PATCH 1/2] misc: ti_fpc202: fix off-by-one error in port ID bounds check Date: Thu, 26 Feb 2026 13:49:11 +0100 Message-ID: <12878336.O9o76ZdvQC@fw-rgant> In-Reply-To: <20260221-fp202-v1-1-4d28cb8b28fb@gmail.com> References: <20260221-fp202-v1-0-4d28cb8b28fb@gmail.com> <20260221-fp202-v1-1-4d28cb8b28fb@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6003659.DvuYhMxLoT"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Last-TLS-Session-Version: TLSv1.3 --nextPart6003659.DvuYhMxLoT Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Romain Gantois Cc: linux-kernel@vger.kernel.org, Felix Gu Date: Thu, 26 Feb 2026 13:49:11 +0100 Message-ID: <12878336.O9o76ZdvQC@fw-rgant> In-Reply-To: <20260221-fp202-v1-1-4d28cb8b28fb@gmail.com> MIME-Version: 1.0 On Friday, 20 February 2026 18:20:31 CET Felix Gu wrote: > FPC202_NUM_PORTS is 2, valid port IDs should be 0 and 1. A port_id of 2 > would incorrectly pass the check, potentially causing out-of-bounds > access to the port-related arrays. > > Found by code review, compile pass. > > Fixes: 1e5c9b1efa1c ("misc: add FPC202 dual port controller driver") > Signed-off-by: Felix Gu > --- > > drivers/misc/ti_fpc202.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/ti_fpc202.c b/drivers/misc/ti_fpc202.c > index 8eb2b5ac9850..578feefb77f1 100644 > --- a/drivers/misc/ti_fpc202.c > +++ b/drivers/misc/ti_fpc202.c > @@ -366,7 +366,7 @@ static int fpc202_probe(struct i2c_client *client) > > goto unregister_chans; > > } > > - if (port_id > FPC202_NUM_PORTS) { > + if (port_id >= FPC202_NUM_PORTS) { > > dev_err(dev, "port ID %d is out of range!\n", port_id); > ret = -EINVAL; > goto unregister_chans; Reviewed-by: Romain Gantois --nextPart6003659.DvuYhMxLoT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEIcCsAScRrtr7W0x0KCYAIARzeA4FAmmgQUcACgkQKCYAIARz eA4s/A/9GYpIFTY2WitMbEoGxGFnz7n8g65zXYY/ba+UigoHkCGMuggCwped/4tf CAQGyLOOSAmJlu8wqZtG2KfE1JqqnH9IwiZ+4Q5AMM5ew0MzxVNXHbetW7Kpnn2/ T5IuysIWjwLODQaMZZfCFAObRblIgHeE4C0Qlr4dOjzBAhAyFCJ9xfbd+TNizdss m3pmfzgn55rS9bwELNHnEIbxxNtBEP4+i116HjprOwu2d51Um55VPSw4H/AVUW+q VBEt6jVYwIz+v+adO3Ak6s4bKAr4RPK6A1Y1V58NKWVVo+SSDTima1o86xmfUKwx 9aZJ6bQZRCtPZO0UIuz9I+RenyzP2Yx2mjZcxwBugiWdYBzxazeMuWBeCNtDrs1d lJaz6cTLAZsrpZHr2cayKzSR8DC/gt9dkhB39OBmfNvGf+U8POoNHXKJtNEC0Olw 3QgVpJV/xFkpZFM/htAx7VKen4Hk18u49D25oOueqU6PrSafkAfOAb8ahx2rD7za GKTYTfnYcBwRmhMUtenFUqTSm/LttgftjrxPijEYN+4VAXnvlNlOLcA4lwiGj9fl bTvPGJDwUreo6dqD+FLooetjkslejSJ/Y6hhurQBH3IkvTsaZvDVUsvD3eHL6Ny9 Fni7J4oqDD5BGpplrpNZJXOwT4gPJ4eUQStmJiH7Gl+OvMCA/tg= =uHkV -----END PGP SIGNATURE----- --nextPart6003659.DvuYhMxLoT--