diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c index 12b45e669bcc3fc28c4524c2bcc966abe304abb4..678b99771cfa46c1bc450dda3ecb115eb2d90fa0 100644 --- a/drivers/media/mc/mc-entity.c +++ b/drivers/media/mc/mc-entity.c @@ -340,6 +340,7 @@ static void media_graph_walk_iter(struct media_graph *graph) stack_push(graph, next); dev_dbg(entity->graph_obj.mdev->dev, "walk: pushing '%s' on stack\n", next->name); + lockdep_assert_held(&entity->graph_obj.mdev->graph_mutex); } struct media_entity *media_graph_walk_next(struct media_graph *graph) diff --git a/include/media/media-entity.h b/include/media/media-entity.h index a90e2bf6baf7f3913ebd869b5635ce9f3ce5f729..09737b47881fdfc3bfdcc39a47fe94d3e0564ba0 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -885,6 +885,11 @@ int media_entity_get_fwnode_pad(struct media_entity *entity, * * @graph: Media graph structure that will be used to walk the graph * @mdev: Pointer to the &media_device that contains the object + * + * The caller is required to hold the media_device graph_mutex during the graph + * walk until the graph state is released. + * + * Returns zero on success or a negative error code otherwise. */ __must_check int media_graph_walk_init( struct media_graph *graph, struct media_device *mdev);