Re: [PATCH 02/25] media: iris: Report unreleased PERSIST buffers on session close
From: Vikash Garodia
Date: Wed Jul 16 2025 - 02:06:29 EST
On 7/4/2025 1:23 PM, Dikshita Agarwal wrote:
> Add error reporting for unreleased PERSIST internal buffers in
> iris_check_num_queued_internal_buffers(). This ensures all buffer types
> are checked and logged if not freed during session close, helping to
> detect memory leaks and improve driver robustness. No change to buffer
> lifecycle or allocation logic.
>
> Fixes: d2abb1ff5a3c ("media: iris: Verify internal buffer release on close")
> Signed-off-by: Dikshita Agarwal <quic_dikshita@xxxxxxxxxxx>
> ---
> drivers/media/platform/qcom/iris/iris_vidc.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/platform/qcom/iris/iris_vidc.c
> index 8285bdaf9466d4bea0f89a3b1943ed7d6c014b7d..96313856a026efaff40da97eaaa63e847172cd57 100644
> --- a/drivers/media/platform/qcom/iris/iris_vidc.c
> +++ b/drivers/media/platform/qcom/iris/iris_vidc.c
> @@ -247,6 +247,14 @@ static void iris_check_num_queued_internal_buffers(struct iris_inst *inst, u32 p
> dev_err(inst->core->dev, "%d buffer of type %d not released",
> count, internal_buf_type[i]);
> }
> +
> + buffers = &inst->buffers[BUF_PERSIST];
> +
> + count = 0;
> + list_for_each_entry_safe(buf, next, &buffers->list, list)
> + count++;
> + if (count)
> + dev_err(inst->core->dev, "%d buffer of type %d not released", count, buf->type);
> }
>
> int iris_close(struct file *filp)
>
Reviewed-by: Vikash Garodia <quic_vgarodia@xxxxxxxxxxx>