From: Wentao Liang <vulab@iscas.ac.cn>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Peter Griffin <peter.griffin@linaro.org>,
Alim Akhtar <alim.akhtar@samsung.com>
Cc: linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
Wentao Liang <vulab@iscas.ac.cn>,
stable@vger.kernel.org
Subject: [PATCH] media: exynos4-is: Free control handler if ISP subdev init fails
Date: Tue, 3 Nov 2026 09:46:16 +0000 [thread overview]
Message-ID: <20261103094616.1289357-1-vulab@iscas.ac.cn> (raw)
fimc_isp_subdev_create() initializes isp->ctrls.handler and creates a
number of standard controls. If any of them cannot be created,
handler->error is set and the function returns after cleaning up the
media entity only. The control handler still owns the memory allocated
for its buckets and for the controls created before the failure, and
neither fimc_isp_subdev_destroy() nor the caller's cleanup runs on this
error path, so that memory is leaked.
Free the control handler before returning the error.
Fixes: 9a761e436843 ("[media] exynos4-is: Add Exynos4x12 FIMC-IS driver")
Cc: stable@vger.kernel.org
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/media/platform/samsung/exynos4-is/fimc-isp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-isp.c b/drivers/media/platform/samsung/exynos4-is/fimc-isp.c
index a0a9093081dd..7790541a2a7a 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-isp.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-isp.c
@@ -761,6 +761,7 @@ int fimc_isp_subdev_create(struct fimc_isp *isp)
if (handler->error) {
media_entity_cleanup(&sd->entity);
+ v4l2_ctrl_handler_free(handler);
return handler->error;
}
--
2.34.1
next reply other threads:[~2026-11-03 9:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 9:46 Wentao Liang [this message]
2026-11-03 10:26 ` Krzysztof Kozlowski
2026-11-04 7:21 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261103094616.1289357-1-vulab@iscas.ac.cn \
--to=vulab@iscas.ac.cn \
--cc=alim.akhtar@samsung.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=peter.griffin@linaro.org \
--cc=s.nawrocki@samsung.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®