Re: [PATCH 1/2] staging: media: tegra-video: fix wrong return type in tegra_get_format_fourcc_by_idx()
From: Dan Carpenter
Date: Mon Apr 13 2026 - 03:27:39 EST
On Sat, Apr 11, 2026 at 11:10:04PM +0200, Alexandru Hossu wrote:
> The function is declared to return u32, but returns -EINVAL on the error
> path. Due to implicit conversion, -EINVAL (-22) becomes 0xFFFFFFEA as u32,
> which is an invalid V4L2 pixel format value.
>
> The caller tegra_channel_enum_format() assigns this garbage value directly
> to f->pixelformat and returns 0 (success) to userspace via VIDIOC_ENUM_FMT,
> giving applications a silently wrong format descriptor instead of an error.
>
> Fix this by changing the return type to int and propagating the error
> correctly in the caller.
>
> Signed-off-by: Alexandru Hossu <hossu.alexandru@xxxxxxxxx>
> ---
Do you think you could analyse this to see if it's a real bug or not.
If it is then give it a Fixes tag.
regards,
dan carpenter