From: Frank Li <Frank.li@nxp.com>
To: michael.riesch@collabora.com
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mehdi Djait <mehdi.djait@linux.intel.com>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Dan Carpenter <dan.carpenter@linaro.org>,
Collabora Kernel Team <kernel@collabora.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@kernel.org
Subject: Re: [PATCH 1/2] media: synopsys: csi2rx: fix out-of-bounds check for formats array
Date: Tue, 17 Feb 2026 10:49:16 -0500 [thread overview]
Message-ID: <aZSN_N8dmPHgczRF@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260216-snps-csi2rx-v1-1-747bc7408f87@collabora.com>
On Mon, Feb 16, 2026 at 01:28:47PM +0100, Michael Riesch via B4 Relay wrote:
> From: Michael Riesch <michael.riesch@collabora.com>
>
> The out-of-bounds check for the format array is off by one. Fix the
> check.
>
> Fixes: 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")
> Cc: stable@kernel.org
> Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
> Signed-off-by: Michael Riesch <michael.riesch@collabora.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> index 170346ae1a59..4d96171a650b 100644
> --- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> +++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
> @@ -301,7 +301,7 @@ dw_mipi_csi2rx_enum_mbus_code(struct v4l2_subdev *sd,
>
> return 0;
> case DW_MIPI_CSI2RX_PAD_SINK:
> - if (code->index > csi2->formats_num)
> + if (code->index >= csi2->formats_num)
> return -EINVAL;
>
> code->code = csi2->formats[code->index].code;
>
> --
> 2.39.5
>
>
next prev parent reply other threads:[~2026-02-17 15:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 12:28 [PATCH 0/2] media: synopsys: csi2rx: various fixes Michael Riesch via B4 Relay
2026-02-16 12:28 ` [PATCH 1/2] media: synopsys: csi2rx: fix out-of-bounds check for formats array Michael Riesch via B4 Relay
2026-02-17 15:49 ` Frank Li [this message]
2026-02-16 12:28 ` [PATCH 2/2] media: synopsys: csi2rx: add missing kconfig dependency Michael Riesch via B4 Relay
2026-02-17 15:49 ` [PATCH 2/2] media: synopsys: csi2rx: add missing kconfig dependencyy Frank Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aZSN_N8dmPHgczRF@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=bryan.odonoghue@linaro.org \
--cc=dan.carpenter@linaro.org \
--cc=hverkuil+cisco@kernel.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mehdi.djait@linux.intel.com \
--cc=michael.riesch@collabora.com \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®