Skip to content

Commit 316e730

Browse files
Hans Verkuilmchehab
authored andcommitted
media: v4l2-mem2mem.c: fix broken links
The topology that v4l2_m2m_register_media_controller() creates for a processing block actually created a source-to-source link and a sink-to-sink link instead of two source-to-sink links. Unfortunately v4l2-compliance never checked for such bad links, so this went unreported for quite some time. Signed-off-by: Hans Verkuil <[email protected]> Reported-by: Nicolas Dufresne <[email protected]> Cc: <[email protected]> # for v4.19 and up Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 49a5626 commit 316e730

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/v4l2-core/v4l2-mem2mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,12 +880,12 @@ int v4l2_m2m_register_media_controller(struct v4l2_m2m_dev *m2m_dev,
880880
goto err_rel_entity1;
881881

882882
/* Connect the three entities */
883-
ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 1,
883+
ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 0,
884884
MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
885885
if (ret)
886886
goto err_rel_entity2;
887887

888-
ret = media_create_pad_link(&m2m_dev->proc, 0, &m2m_dev->sink, 0,
888+
ret = media_create_pad_link(&m2m_dev->proc, 1, &m2m_dev->sink, 0,
889889
MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
890890
if (ret)
891891
goto err_rm_links0;

0 commit comments

Comments
 (0)