Re: [PATCH] media: exynos4-is: Free the control handler if fimc_ctrls_create() fails
From: Krzysztof Kozlowski
Date: Wed Nov 04 2026 - 02:23:31 EST
On 03/11/2026 10:46, Wentao Liang wrote:
> v4l2_ctrl_handler_init() allocates the handler's bucket array, and each
> subsequent v4l2_ctrl_new_std() call allocates a control. When one of
> those calls fails it only records the error in handler->error.
> fimc_ctrls_create() returns that error with ctrls->ready left false, so
> neither caller calls fimc_ctrls_delete(), and that function would not
> free the handler in that state anyway. The bucket array and the
> controls created so far are leaked.
>
> Free the handler before returning the error.
>
> Fixes: 9448ab7dec30 ("[media] s5p-fimc: Add color effect control")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
This is another posting of bot ignoring feedback and probably
introducing vilnerabilities hidden in big spam posting.
Best regards,
Krzysztof