diff options
| author | Guangshuo Li <lgs201920130244@gmail.com> | 2026-09-15 16:50:31 +0800 |
|---|---|---|
| committer | Sakari Ailus <sakari.ailus@linux.intel.com> | 2026-09-15 13:56:03 +0300 |
| commit | 06d4f202f007b160e650e8dd861a5fc223024f34 (patch) | |
| tree | 6e8a0b7aa44ff5400afe51ec726d035bb0578bbe | |
| parent | a26c5ac46191ae34b3413f7a45d6241f63e15d42 (diff) | |
| download | linux-next-06d4f202f007b160e650e8dd861a5fc223024f34.tar.gz linux-next-06d4f202f007b160e650e8dd861a5fc223024f34.zip | |
media: i2c: ov2735: fix power cleanup on remove
ov2735_probe() explicitly powers on the sensor before enabling runtime
PM. The probe failure paths call ov2735_power_off(), but the remove path
does not perform the corresponding power-off operation.
The managed runtime PM helpers only clean up the runtime PM state.
devm_pm_runtime_set_active_enabled() disables runtime PM and restores
the suspended state during device resource release, while
devm_pm_runtime_get_noresume() drops the runtime PM usage reference.
Neither helper invokes ov2735_power_off().
As a result, removing the driver after a successful probe can leave the
sensor clock and regulators enabled and the GPIOs in the powered state.
Call ov2735_power_off() from ov2735_remove() to match the successful
ov2735_power_on() performed during probe.
This issue was found by manual code inspection.
Fixes: fa9e6df636fb ("media: i2c: add ov2735 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
| -rw-r--r-- | drivers/media/i2c/ov2735.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/i2c/ov2735.c b/drivers/media/i2c/ov2735.c index dcb1add1fd9f..2defcaa8b795 100644 --- a/drivers/media/i2c/ov2735.c +++ b/drivers/media/i2c/ov2735.c @@ -1081,6 +1081,7 @@ static void ov2735_remove(struct i2c_client *client) v4l2_subdev_cleanup(&ov2735->sd); media_entity_cleanup(&sd->entity); v4l2_ctrl_handler_free(ov2735->sd.ctrl_handler); + ov2735_power_off(ov2735->dev); } static DEFINE_RUNTIME_DEV_PM_OPS(ov2735_pm_ops, |
