[PATCH 5/5] media: i2c: st-mipid02: Add missing v4l2_subdev_cleanup() call

From: Aleksandr Chubuchnyi

Date: Wed Sep 09 2026 - 04:26:56 EST


The subdev active state allocated by v4l2_subdev_init_finalize() is leaked
on unbind. The driver has no common cleanup helper, so update both sites.

Fixes: 04d170b288b3 ("media: i2c: st-mipid02: use active state to store pad formats")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Aleksandr Chubuchnyi <chubuchnyi@xxxxxxxxx>
---
drivers/media/i2c/st-mipid02.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c
index 4675181af..b2f275129 100644
--- a/drivers/media/i2c/st-mipid02.c
+++ b/drivers/media/i2c/st-mipid02.c
@@ -919,6 +919,7 @@ static int mipid02_probe(struct i2c_client *client)
power_off:
mipid02_set_power_off(&client->dev);
entity_cleanup:
+ v4l2_subdev_cleanup(&bridge->sd);
media_entity_cleanup(&bridge->sd.entity);

return ret;
@@ -937,6 +938,7 @@ static void mipid02_remove(struct i2c_client *client)
if (!pm_runtime_status_suspended(&client->dev))
mipid02_set_power_off(&client->dev);
pm_runtime_set_suspended(&client->dev);
+ v4l2_subdev_cleanup(&bridge->sd);
media_entity_cleanup(&bridge->sd.entity);
}

--
2.43.0