[PATCH 4/5] media: i2c: ov8858: Add missing v4l2_subdev_cleanup() call
From: Aleksandr Chubuchnyi
Date: Wed Sep 09 2026 - 04:18:57 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: e14d3ac81bd2 ("media: i2c: Add driver for OmniVision OV8858")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Aleksandr Chubuchnyi <chubuchnyi@xxxxxxxxx>
---
drivers/media/i2c/ov8858.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/i2c/ov8858.c b/drivers/media/i2c/ov8858.c
index 3f45f7fab..2076620c7 100644
--- a/drivers/media/i2c/ov8858.c
+++ b/drivers/media/i2c/ov8858.c
@@ -1953,6 +1953,7 @@ static int ov8858_probe(struct i2c_client *client)
pm_runtime_put_noidle(dev);
ov8858_power_off(ov8858);
err_clean_entity:
+ v4l2_subdev_cleanup(sd);
media_entity_cleanup(&sd->entity);
err_free_handler:
v4l2_ctrl_handler_free(&ov8858->ctrl_handler);
@@ -1966,6 +1967,7 @@ static void ov8858_remove(struct i2c_client *client)
struct ov8858 *ov8858 = sd_to_ov8858(sd);
v4l2_async_unregister_subdev(sd);
+ v4l2_subdev_cleanup(sd);
media_entity_cleanup(&sd->entity);
v4l2_ctrl_handler_free(&ov8858->ctrl_handler);
--
2.43.0