[PATCH v2] media: mediatek: vcodec: free working buf in vdec_vp9_slice_setup_single()

Nicolas Dufresne nicolas at ndufresne.ca
Fri May 1 11:43:42 PDT 2026


Le mercredi 29 avril 2026 à 15:01 +0800, Haoxiang Li a écrit :
> Add an error path label in vdec_vp9_slice_setup_single()
> and call vdec_vp9_slice_free_working_buffer() to free
> working buffer.
> 
> Fixes: b0f407c19648 ("media: mediatek: vcodec: add vp9 decoder driver for
> mt8186")
> Cc: stable at vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang at isrc.iscas.ac.cn>
> ---
> Changes in v2:
>  - Remove vdec_vp9_slice_setup_prob_buffer()'s return
>    value, since it never fails. Thanks, Nicolas!
> ---
>  .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c   | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git
> a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
> b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
> index cd1935014d76..d034d84ad7f1 100644
> ---
> a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
> +++
> b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c
> @@ -1808,17 +1808,16 @@ static int vdec_vp9_slice_setup_single(struct
> vdec_vp9_slice_instance *instance,
>  
>  	vdec_vp9_slice_setup_single_buffer(instance, pfc, vsi, bs, fb);
>  	vdec_vp9_slice_setup_seg_buffer(instance, vsi, &instance->seg[0]);
> -
> -	ret = vdec_vp9_slice_setup_prob_buffer(instance, vsi);

Same as previous patch.

regards,
Nicolas

> -	if (ret)
> -		goto err;
> +	vdec_vp9_slice_setup_prob_buffer(instance, vsi);
>  
>  	ret = vdec_vp9_slice_setup_tile_buffer(instance, vsi, bs);
>  	if (ret)
> -		goto err;
> +		goto alloc_err;
>  
>  	return 0;
>  
> +alloc_err:
> +	vdec_vp9_slice_free_working_buffer(instance);
>  err:
>  	return ret;
>  }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260501/3846261b/attachment.sig>


More information about the linux-arm-kernel mailing list