Re: [PATCH] media: subdev: Fix error pointer dereference
From: Ethan Tidmore
Date: Fri Mar 13 2026 - 23:07:17 EST
On Fri Mar 13, 2026 at 10:02 PM CDT, Ethan Tidmore wrote:
> The function media_pad_remote_pad_unique() returns an error pointer upon
> failure, not null.
>
> Add check for error pointer and extract the error code with PTR_ERR().
Detected by Smatch:
drivers/media/v4l2-core/v4l2-subdev.c:2588 v4l2_subdev_get_frame_desc_passthrough() warn:
'remote_source_pad' is an error pointer or valid
drivers/media/v4l2-core/v4l2-subdev.c:2595 v4l2_subdev_get_frame_desc_passthrough() error:
'remote_source_pad' dereferencing possible ERR_PTR()
>
> Fixes: a564839e630c1 ("media: subdev: Add v4l2_subdev_get_frame_desc_passthrough helper")
> Signed-off-by: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
> ---
Forgot to add the Smatch warnings, if this version is good please add
this to the commit message.
Thanks,
ET