[PATCH] media: rockchip: rkcif: Fix error handling for media_entity_remote_source_pad_unique()
Mehdi Djait
mehdi.djait at linux.intel.com
Fri May 22 01:25:25 PDT 2026
Hello Chen,
Thank you for the patch.
I see this issue in the rpi cfe driver also.
On Fri, May 22, 2026 at 02:55:48PM +0800, Chen Ni wrote:
> The media_entity_remote_source_pad_unique() function returns an error
> pointer on failure, not NULL. Fix the check to use IS_ERR() and return
> PTR_ERR() to correctly handle allocation failures.
>
> Fixes: 501802e2ad51 ("media: rockchip: rkcif: add abstraction for dma blocks")
Reviewed-by: Mehdi Djait <mehdi.djait at linux.intel.com>
> Signed-off-by: Chen Ni <nichen at iscas.ac.cn>
> ---
> drivers/media/platform/rockchip/rkcif/rkcif-stream.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rockchip/rkcif/rkcif-stream.c b/drivers/media/platform/rockchip/rkcif/rkcif-stream.c
> index 3130d420ad55..542aa877919d 100644
> --- a/drivers/media/platform/rockchip/rkcif/rkcif-stream.c
> +++ b/drivers/media/platform/rockchip/rkcif/rkcif-stream.c
> @@ -466,7 +466,7 @@ static int rkcif_stream_link_validate(struct media_link *link)
> struct rkcif_stream *stream = to_rkcif_stream(vdev);
> int ret = -EINVAL;
>
> - if (!media_entity_remote_source_pad_unique(link->sink->entity))
> + if (IS_ERR(media_entity_remote_source_pad_unique(link->sink->entity)))
> return -ENOTCONN;
>
> sd = media_entity_to_v4l2_subdev(link->source->entity);
--
Kind Regards
Mehdi Djait
More information about the linux-arm-kernel
mailing list