Re: [PATCH v2 1/1] media: tegra-video: vi: fix invalid u32 return value in format lookup
From: Luca Ceresoli
Date: Wed May 06 2026 - 07:41:28 EST
On Wed, 06 May 2026 07:57:45 +0000, Hungyu Lin <dennylin0707@xxxxxxxxx> wrote:
> tegra_get_format_fourcc_by_idx() returns a u32 but uses -EINVAL to
> signal an out-of-bounds index. This results in a large unsigned
> value being returned, which may be interpreted as a valid fourcc.
>
> Returning 0 is not a valid fourcc either. This condition should
> never happen, so use WARN_ON_ONCE() to catch unexpected out-of-bounds
> access and return a valid fallback format instead.
>
> Suggested-by: Hans Verkuil <hverkuil+cisco@xxxxxxxxxx>
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
Being a fix it should have a Fixes tag and Cc stable. I think the right
commit is 3d8a97eabef0, so:
+Cc: stable@xxxxxxxxxxxxxxx
+Fixes: 3d8a97eabef0 ("media: tegra-video: Add Tegra210 Video input driver")
With that added:
+Reviewed-by: Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx>
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com