[PATCH 3/5] media: i2c: mt9m114: Add missing v4l2_subdev_cleanup() calls

From: Aleksandr Chubuchnyi

Date: Wed Sep 09 2026 - 04:15:42 EST


The subdev active state allocated by v4l2_subdev_init_finalize() is leaked
on unbind, for both the pixel array and the image flow processor subdev.

Fixes: 24d756e914fc ("media: i2c: Add driver for onsemi MT9M114 camera sensor")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Aleksandr Chubuchnyi <chubuchnyi@xxxxxxxxx>
---
drivers/media/i2c/mt9m114.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c
index 848ea06e7..137e8e6df 100644
--- a/drivers/media/i2c/mt9m114.c
+++ b/drivers/media/i2c/mt9m114.c
@@ -1482,6 +1482,7 @@ static int mt9m114_pa_init(struct mt9m114 *sensor)

static void mt9m114_pa_cleanup(struct mt9m114 *sensor)
{
+ v4l2_subdev_cleanup(&sensor->pa.sd);
v4l2_ctrl_handler_free(&sensor->pa.hdl);
media_entity_cleanup(&sensor->pa.sd.entity);
}
@@ -2208,6 +2209,7 @@ static int mt9m114_ifp_init(struct mt9m114 *sensor)

static void mt9m114_ifp_cleanup(struct mt9m114 *sensor)
{
+ v4l2_subdev_cleanup(&sensor->ifp.sd);
v4l2_ctrl_handler_free(&sensor->ifp.hdl);
media_entity_cleanup(&sensor->ifp.sd.entity);
}
--
2.43.0