Re: [PATCH for v5.6] v4l2-mem2mem.c: fix broken links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> Reported-by: Nicolas Dufresne <nicolas@xxxxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>      # 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;




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux