Commit af3ed78e authored by Daniel Scally's avatar Daniel Scally Committed by Mauro Carvalho Chehab

media: entity: Skip non-data links in graph iteration

When iterating over the media graph, don't follow links that are not
data links.
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarDaniel Scally <djrscally@gmail.com>
Reviewed-by: default avatarJean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 6008dea1
...@@ -295,6 +295,12 @@ static void media_graph_walk_iter(struct media_graph *graph) ...@@ -295,6 +295,12 @@ static void media_graph_walk_iter(struct media_graph *graph)
link = list_entry(link_top(graph), typeof(*link), list); link = list_entry(link_top(graph), typeof(*link), list);
/* If the link is not a data link, don't follow it */
if ((link->flags & MEDIA_LNK_FL_LINK_TYPE) != MEDIA_LNK_FL_DATA_LINK) {
link_top(graph) = link_top(graph)->next;
return;
}
/* The link is not enabled so we do not follow. */ /* The link is not enabled so we do not follow. */
if (!(link->flags & MEDIA_LNK_FL_ENABLED)) { if (!(link->flags & MEDIA_LNK_FL_ENABLED)) {
link_top(graph) = link_top(graph)->next; link_top(graph) = link_top(graph)->next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment