lkml.org 
[lkml]   [2026]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] staging: media: tegra-video: fix wrong return type in tegra_get_format_fourcc_by_idx()
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@gmail.com>
> ---

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


\
 
 \ /
  Last update: 2026-04-13 09:28    [W:0.119 / U:1.827 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog