linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH for v5.6] v4l2-mem2mem.c: fix broken links
Date: Tue, 04 Feb 2020 14:39:54 -0500	[thread overview]
Message-ID: <7498931438e4e58d3efc51ff34d6a9752cfc729f.camel@ndufresne.ca> (raw)
In-Reply-To: <8974b23a-6823-d47b-fda4-fe9bd6f7e6d1@xs4all.nl>

Le mardi 04 février 2020 à 19:13 +0100, Hans Verkuil a écrit :
> The topology that v4l2_m2m_register_media_controller() creates for a
> processing block actually created a source-to-source link and a sink-to-sink
> link instead of two source-to-sink links.
> 
> Unfortunately v4l2-compliance never checked for such bad links, so this
> went unreported for quite some time.
> 
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Reported-by: Nicolas Dufresne <nicolas@ndufresne.ca>
> Cc: <stable@vger.kernel.org>      # for v4.19 and up
> ---
> diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-
> core/v4l2-mem2mem.c
> index 1afd9c6ad908..cc34c5ab7009 100644
> --- a/drivers/media/v4l2-core/v4l2-mem2mem.c
> +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
> @@ -880,12 +880,12 @@ int v4l2_m2m_register_media_controller(struct
> v4l2_m2m_dev *m2m_dev,
>  		goto err_rel_entity1;
> 
>  	/* Connect the three entities */
> -	ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 1,
> +	ret = media_create_pad_link(m2m_dev->source, 0, &m2m_dev->proc, 0,

I think local defines to give a name to these 0 and 1 indexes would be more
readable. Note, I could not test your patch as Hantro does not use this code
path. But I'm not worried, this is covered by virtual drivers and tests.

>  			MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
>  	if (ret)
>  		goto err_rel_entity2;
> 
> -	ret = media_create_pad_link(&m2m_dev->proc, 0, &m2m_dev->sink, 0,
> +	ret = media_create_pad_link(&m2m_dev->proc, 1, &m2m_dev->sink, 0,
>  			MEDIA_LNK_FL_IMMUTABLE | MEDIA_LNK_FL_ENABLED);
>  	if (ret)
>  		goto err_rm_links0;


      reply	other threads:[~2020-02-04 19:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 18:13 [PATCH for v5.6] v4l2-mem2mem.c: fix broken links Hans Verkuil
2020-02-04 19:39 ` Nicolas Dufresne [this message]

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=7498931438e4e58d3efc51ff34d6a9752cfc729f.camel@ndufresne.ca \
    --to=nicolas@ndufresne.ca \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).