Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8aaf62b5 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[media] media: Enforce single entity->pipe in a pipeline



If a different entity->pipe in a pipeline was encountered, a warning was
issued but the execution continued as if nothing had happened. Return an
error instead right there.

Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 677cb4bf
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -323,7 +323,12 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
		DECLARE_BITMAP(has_no_links, MEDIA_ENTITY_MAX_PADS);

		entity->stream_count++;
		WARN_ON(entity->pipe && entity->pipe != pipe);

		if (WARN_ON(entity->pipe && entity->pipe != pipe)) {
			ret = -EBUSY;
			goto error;
		}

		entity->pipe = pipe;

		/* Already streaming --- no need to check. */