 20ea6adbf1
			
		
	
	20ea6adbf1
	
	
	
		
			
			Build system: x86_64 Build-tested: bcm2708, bcm2709, bcm2710, bcm2711 Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B Signed-off-by: Marty Jones <mj8263788@gmail.com> Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
		
			
				
	
	
		
			30 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 74a4bd2caa37f07786cdf3e86ad9f7cbc6977b31 Mon Sep 17 00:00:00 2001
 | |
| From: Daniel Scally <djrscally@gmail.com>
 | |
| Date: Wed, 2 Mar 2022 22:03:00 +0000
 | |
| Subject: [PATCH] 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 <laurent.pinchart@ideasonboard.com>
 | |
| Signed-off-by: Daniel Scally <djrscally@gmail.com>
 | |
| ---
 | |
|  drivers/media/mc/mc-entity.c | 6 ++++++
 | |
|  1 file changed, 6 insertions(+)
 | |
| 
 | |
| --- a/drivers/media/mc/mc-entity.c
 | |
| +++ b/drivers/media/mc/mc-entity.c
 | |
| @@ -313,6 +313,12 @@ static void media_graph_walk_iter(struct
 | |
|  
 | |
|  	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;
 |