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

From: Nicolas Dufresne

Date: Tue Apr 28 2026 - 16:37:56 EST


Le lundi 30 mars 2026 à 10:11 +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@xxxxxxxxxxxxxxx
> Signed-off-by: Haoxiang Li <lihaoxiang@xxxxxxxxxxxxxxxx>
> ---
>  .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c      | 6 ++++--
>  1 file changed, 4 insertions(+), 2 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..b3ecb94bebb3 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
> @@ -1811,14 +1811,16 @@ static int vdec_vp9_slice_setup_single(struct vdec_vp9_slice_instance *instance,
>  
>   ret = vdec_vp9_slice_setup_prob_buffer(instance, vsi);

This function never fails, remove its return value and remove the error code
below.

>   if (ret)
> - goto err;
> + goto alloc_err;
>  
>   ret = vdec_vp9_slice_setup_tile_buffer(instance, vsi, bs);
>   if (ret)
> - goto err;
> + goto alloc_err;

Ack.

cheers,
Nicolas

>  
>   return 0;
>  
> +alloc_err:
> + vdec_vp9_slice_free_working_buffer(instance);
>  err:
>   return ret;
>  }

Attachment: signature.asc
Description: This is a digitally signed message part