History

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

When iterating over the media graph, don't follow links that are not data links.

Daniel Scally committed 4 years ago

Commit af3ed781 parent 6008dea1 file · +6 −0Browse files

Unified · Split

drivers/media/mc/mc-entity.c+6−0
@@ -295,6 +295,12 @@ static void media_graph_walk_iter(struct media_graph *graph) · 294 unmodified lines
295 295
296 link = list_entry(link_top(graph), typeof(*link), list);296 link = list_entry(link_top(graph), typeof(*link), list);
297 297
298 /* If the link is not a data link, don't follow it */
299 if ((link->flags & MEDIA_LNK_FL_LINK_TYPE) != MEDIA_LNK_FL_DATA_LINK) {
300 link_top(graph) = link_top(graph)->next;
301 return;
302 }
303
298 /* The link is not enabled so we do not follow. */304 /* The link is not enabled so we do not follow. */
299 if (!(link->flags & MEDIA_LNK_FL_ENABLED)) {305 if (!(link->flags & MEDIA_LNK_FL_ENABLED)) {
300 link_top(graph) = link_top(graph)->next;306 link_top(graph) = link_top(graph)->next;