Skip to content

Commit c5229fc

Browse files
adrien-lessardcfriedt
authored andcommitted
pm: device_runtime: fix pm_device_runtime_get rollback
In a call to pm_device_runtime_get, if the power domain is taken but action_cb fails, the power domain is not released. Signed-off-by: Adrien Lessard <[email protected]>
1 parent add2c83 commit c5229fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subsys/pm/device_runtime.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ int pm_device_runtime_get(const struct device *dev)
283283
ret = pm->base.action_cb(pm->dev, PM_DEVICE_ACTION_RESUME);
284284
if (ret < 0) {
285285
pm->base.usage--;
286+
if (domain != NULL) {
287+
(void)pm_device_runtime_put(domain);
288+
}
286289
goto unlock;
287290
}
288291

0 commit comments

Comments
 (0)