[PATCH] media: i2c: ov13b10: fix power leak on remove while runtime-active

From: Cong Nguyen

Date: Mon Sep 28 2026 - 10:05:48 EST


ov13b10_remove() calls pm_runtime_set_suspended(), but that's pure
bookkeeping -- it doesn't call ov13b10_suspend() (which actually
deasserts reset, disables the regulators, and disables/unprepares the
clock via ov13b10_power_off()).

If unbound while ov13b10_set_stream() is holding an outstanding PM
reference (removed while actively streaming), the device stays
genuinely active with regulators/clock enabled forever after.

Call ov13b10_suspend() in that case, guarded by
pm_runtime_status_suspended() so the common already-suspended case
isn't suspended twice -- same guard sibling imx412.c's remove() uses.

Fixes: 7ee850546822 ("media: Add sensor driver support for the ov13b10 camera.")
Assisted-by: LLM
Signed-off-by: Cong Nguyen <congnt264@xxxxxxxxx>
---
drivers/media/i2c/ov13b10.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/ov13b10.c b/drivers/media/i2c/ov13b10.c
index b0d34141a13a..ab5cf9af2e85 100644
--- a/drivers/media/i2c/ov13b10.c
+++ b/drivers/media/i2c/ov13b10.c
@@ -1688,6 +1688,8 @@ static void ov13b10_remove(struct i2c_client *client)
ov13b10_free_controls(ov13b);

pm_runtime_disable(ov13b->dev);
+ if (!pm_runtime_status_suspended(ov13b->dev))
+ ov13b10_suspend(ov13b->dev);
pm_runtime_set_suspended(ov13b->dev);
}

--
2.25.1