summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2015-11-29 20:20:02 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 15:19:12 +0100
commit8aaf62b5b9bef73978973e4b825c7818528d3ca2 (patch)
tree78bdfa6eb1c7e2a958a340d2664bf50faae420e2 /drivers/media
parent[media] DocBook: Document MEDIA_IOC_G_TOPOLOGY (diff)
downloadlinux-8aaf62b5b9bef73978973e4b825c7818528d3ca2.tar.xz
linux-8aaf62b5b9bef73978973e4b825c7818528d3ca2.zip
[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: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/media-entity.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 6926e0685d0a..4822763dcefa 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -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. */