When iterating over the media graph, don't follow links that are not data links.
Unified · Split
| @@ -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; |