public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: sakari.ailus@iki.fi, mchehab@kernel.org,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] media: entity: Catch unbalanced media_pipeline_stop calls
Date: Tue, 03 Jan 2017 15:36:43 +0200	[thread overview]
Message-ID: <2426604.oXt7iAeI8O@avalon> (raw)
In-Reply-To: <1483449131-18075-1-git-send-email-kieran.bingham+renesas@ideasonboard.com>

Hi Kieran,

Thank you for the patch.

On Tuesday 03 Jan 2017 13:12:11 Kieran Bingham wrote:
> Drivers must not perform unbalanced calls to stop the entity pipeline,
> however if they do they will fault in the core media code, as the
> entity->pipe will be set as NULL. We handle this gracefully in the core
> with a WARN for the developer.
> 
> Replace the erroneous check on zero streaming counts, with a check on
> NULL pipe elements instead, as this is the symptom of unbalanced
> media_pipeline_stop calls.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

This looks good to me,

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I'll let Sakari review and merge the patch.

> ---
>  drivers/media/media-entity.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index caa13e6f09f5..cb1fb2c17f85 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -534,8 +534,13 @@ void __media_pipeline_stop(struct media_entity *entity)
> struct media_graph *graph = &entity->pipe->graph;
>  	struct media_pipeline *pipe = entity->pipe;
> 
> +	/*
> +	 * If the following check fails, the driver has performed an
> +	 * unbalanced call to media_pipeline_stop()
> +	 */
> +	if (WARN_ON(!pipe))
> +		return;
> 
> -	WARN_ON(!pipe->streaming_count);
>  	media_graph_walk_start(graph, entity);
> 
>  	while ((entity = media_graph_walk_next(graph))) {

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2017-01-03 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 13:12 [PATCH] media: entity: Catch unbalanced media_pipeline_stop calls Kieran Bingham
2017-01-03 13:36 ` Laurent Pinchart [this message]
2017-01-03 17:05   ` Kieran Bingham
2017-01-04  8:57     ` Sakari Ailus
2017-05-05 17:33       ` Kieran Bingham
2017-05-05 21:11         ` Sakari Ailus
2017-05-06 17:23           ` Kieran Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2426604.oXt7iAeI8O@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox