diff options
| author | Daniel Scally <[email protected]> | 2022-03-02 22:03:00 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2022-04-24 07:57:21 +0100 |
| commit | af3ed78ecbf367008ae4852cd676a75ce71db35f (patch) | |
| tree | fe978791514fa43e42eb2fc3cec7e15f5208dbdd | |
| parent | 6008dea1c70e1a7df05c5e1bccd48e51ea29e670 (diff) | |
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: Laurent Pinchart <[email protected]>
Signed-off-by: Daniel Scally <[email protected]>
Reviewed-by: Jean-Michel Hautbois <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
| -rw-r--r-- | drivers/media/mc/mc-entity.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 20f5a76bd78b..379898ca704c 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -295,6 +295,12 @@ static void media_graph_walk_iter(struct media_graph *graph) 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. */ if (!(link->flags & MEDIA_LNK_FL_ENABLED)) { link_top(graph) = link_top(graph)->next; |