* [PATCH] media: rockchip: rkcif: Use IS_ERR() check for media_entity_remote_source_pad_unique()
@ 2026-07-10 20:30 Jang Ingyu
2026-07-13 8:55 ` Mehdi Djait
0 siblings, 1 reply; 2+ messages in thread
From: Jang Ingyu @ 2026-07-10 20:30 UTC (permalink / raw)
To: Mehdi Djait, Michael Riesch, Mauro Carvalho Chehab,
Heiko Stuebner
Cc: linux-media, linux-arm-kernel, linux-rockchip, linux-kernel
From: Ingyu Jang <ingyujang25@korea.ac.kr>
media_entity_remote_source_pad_unique() returns either a valid struct
media_pad pointer or an error pointer (ERR_PTR(-ENOTUNIQ) or
ERR_PTR(-ENOLINK)); it never returns NULL. The current NULL check
therefore never triggers, and the "pad not connected" error path is
unreachable.
Replace the NULL check with an IS_ERR() check so the validation
actually detects malformed media graphs.
Signed-off-by: Ingyu Jang <ingyujang25@korea.ac.kr>
---
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 3130d420ad559..542aa877919df 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);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: rockchip: rkcif: Use IS_ERR() check for media_entity_remote_source_pad_unique()
2026-07-10 20:30 [PATCH] media: rockchip: rkcif: Use IS_ERR() check for media_entity_remote_source_pad_unique() Jang Ingyu
@ 2026-07-13 8:55 ` Mehdi Djait
0 siblings, 0 replies; 2+ messages in thread
From: Mehdi Djait @ 2026-07-13 8:55 UTC (permalink / raw)
To: Jang Ingyu
Cc: Michael Riesch, Mauro Carvalho Chehab, Heiko Stuebner,
linux-media, linux-arm-kernel, linux-rockchip, linux-kernel
Hello,
On Sat, Jul 11, 2026 at 05:30:16AM +0900, Jang Ingyu wrote:
> From: Ingyu Jang <ingyujang25@korea.ac.kr>
>
> media_entity_remote_source_pad_unique() returns either a valid struct
> media_pad pointer or an error pointer (ERR_PTR(-ENOTUNIQ) or
> ERR_PTR(-ENOLINK)); it never returns NULL. The current NULL check
> therefore never triggers, and the "pad not connected" error path is
> unreachable.
>
> Replace the NULL check with an IS_ERR() check so the validation
> actually detects malformed media graphs.
>
> Signed-off-by: Ingyu Jang <ingyujang25@korea.ac.kr>
> ---
> 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 3130d420ad559..542aa877919df 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;
This was already fixed in:
https://lore.kernel.org/linux-media/20260522065548.2438545-1-nichen@iscas.ac.cn/
--
Kind Regards
Mehdi Djait
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-13 8:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 20:30 [PATCH] media: rockchip: rkcif: Use IS_ERR() check for media_entity_remote_source_pad_unique() Jang Ingyu
2026-07-13 8:55 ` Mehdi Djait
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox