* [PATCH] media: mali-c55: Free the ISP control handler on unregister
@ 2026-09-06 7:10 David Carlier
2026-09-30 15:24 ` Jacopo Mondi
0 siblings, 1 reply; 2+ messages in thread
From: David Carlier @ 2026-09-06 7:10 UTC (permalink / raw)
To: linux-media
Cc: dan.scally, jacopo.mondi, mchehab, nayden.kanchev,
hverkuil+cisco, stable, linux-kernel, David Carlier
mali_c55_isp_init_controls() initialises isp->handler and adds the
capabilities control, but mali_c55_unregister_isp() never frees it.
Neither v4l2_device_unregister_subdev() nor v4l2_subdev_cleanup()
touches sd->ctrl_handler, so the handler and its control are leaked on
every unbind or module removal. The probe error path already frees it,
and the TPG subdevice does so in its own unregister function.
Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
Cc: stable@vger.kernel.org
Signed-off-by: David Carlier <devnexen@gmail.com>
---
drivers/media/platform/arm/mali-c55/mali-c55-isp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c b/drivers/media/platform/arm/mali-c55/mali-c55-isp.c
index e128adf6ee37..c45a3760e084 100644
--- a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c
+++ b/drivers/media/platform/arm/mali-c55/mali-c55-isp.c
@@ -641,6 +641,7 @@ void mali_c55_unregister_isp(struct mali_c55 *mali_c55)
mutex_destroy(&isp->capture_lock);
v4l2_device_unregister_subdev(&isp->sd);
+ v4l2_ctrl_handler_free(&isp->handler);
v4l2_subdev_cleanup(&isp->sd);
media_entity_cleanup(&isp->sd.entity);
}
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] media: mali-c55: Free the ISP control handler on unregister
2026-09-06 7:10 [PATCH] media: mali-c55: Free the ISP control handler on unregister David Carlier
@ 2026-09-30 15:24 ` Jacopo Mondi
0 siblings, 0 replies; 2+ messages in thread
From: Jacopo Mondi @ 2026-09-30 15:24 UTC (permalink / raw)
To: David Carlier
Cc: linux-media, dan.scally, jacopo.mondi, mchehab, nayden.kanchev,
hverkuil+cisco, stable, linux-kernel
Hi David
On Sun, Sep 06, 2026 at 08:10:30AM +0100, David Carlier wrote:
> mali_c55_isp_init_controls() initialises isp->handler and adds the
> capabilities control, but mali_c55_unregister_isp() never frees it.
> Neither v4l2_device_unregister_subdev() nor v4l2_subdev_cleanup()
> touches sd->ctrl_handler, so the handler and its control are leaked on
> every unbind or module removal. The probe error path already frees it,
> and the TPG subdevice does so in its own unregister function.
>
> Fixes: d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
> drivers/media/platform/arm/mali-c55/mali-c55-isp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c b/drivers/media/platform/arm/mali-c55/mali-c55-isp.c
> index e128adf6ee37..c45a3760e084 100644
> --- a/drivers/media/platform/arm/mali-c55/mali-c55-isp.c
> +++ b/drivers/media/platform/arm/mali-c55/mali-c55-isp.c
> @@ -641,6 +641,7 @@ void mali_c55_unregister_isp(struct mali_c55 *mali_c55)
>
> mutex_destroy(&isp->capture_lock);
> v4l2_device_unregister_subdev(&isp->sd);
> + v4l2_ctrl_handler_free(&isp->handler);
> v4l2_subdev_cleanup(&isp->sd);
> media_entity_cleanup(&isp->sd.entity);
> }
> --
> 2.55.0
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-30 15:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-06 7:10 [PATCH] media: mali-c55: Free the ISP control handler on unregister David Carlier
2026-09-30 15:24 ` Jacopo Mondi
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®