summaryrefslogtreecommitdiffstats
path: root/drivers/media/media-entity.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2016-07-20 09:19:03 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-01-27 12:31:32 -0200
commit12030f489ef87dd879400d65381482a1f2177adc (patch)
treea5e91b1c69730f3d897aed04e6030acdc8cfe4c6 /drivers/media/media-entity.c
parent41387a59c8fd55975c6a26cc12fc5c9ca61fcc0f (diff)
downloadop-kernel-dev-12030f489ef87dd879400d65381482a1f2177adc.zip
op-kernel-dev-12030f489ef87dd879400d65381482a1f2177adc.tar.gz
[media] media: entity: Be vocal about failing sanity checks
Commit 3801bc7d1b8d ("[media] media: Media Controller fix to not let stream_count go negative") added a sanity check for negative stream_count, but a failure of the check remained silent. Make sure the failure is noticed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r--drivers/media/media-entity.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 0408d86..d372608 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -469,8 +469,8 @@ error:
media_entity_graph_walk_start(graph, entity_err);
while ((entity_err = media_entity_graph_walk_next(graph))) {
- /* don't let the stream_count go negative */
- if (entity_err->stream_count > 0) {
+ /* Sanity check for negative stream_count */
+ if (!WARN_ON_ONCE(entity_err->stream_count <= 0)) {
entity_err->stream_count--;
if (entity_err->stream_count == 0)
entity_err->pipe = NULL;
@@ -515,8 +515,8 @@ void __media_entity_pipeline_stop(struct media_entity *entity)
media_entity_graph_walk_start(graph, entity);
while ((entity = media_entity_graph_walk_next(graph))) {
- /* don't let the stream_count go negative */
- if (entity->stream_count > 0) {
+ /* Sanity check for negative stream_count */
+ if (!WARN_ON_ONCE(entity->stream_count <= 0)) {
entity->stream_count--;
if (entity->stream_count == 0)
entity->pipe = NULL;
OpenPOWER on IntegriCloud