media: raspberrypi: Fix error handling for media_entity_remote_source_pad_unique()
Subsystems (3)
PATCH 1/1 media: raspberrypi: Fix error handling for media_entity_remote_source_pad_unique()
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 6edb685abb2a ("media: raspberrypi: Add support for RP1-CFE")
Signed-off-by Triet Hoang <[email protected]>
--- drivers/media/platform/raspberrypi/rp1-cfe/cfe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/raspberrypi/rp1-cfe/cfe.c +1 -1
@@ -1779,7 +1779,7 @@ static int cfe_video_link_validate(struct media_link *link) link->source->entity->name, link->source->index, link->sink->entity->name, link->sink->index); -if (!media_entity_remote_source_pad_unique (link->sink->entity)) { +if (IS_ERR (media_entity_remote_source_pad_unique (link->sink->entity))) {cfe_err (cfe,"video node %s pad not connected\n" , vd->name);return -ENOTCONN ; }
Signature · 1 line
2.53.0