Skip to content

Commit 1a37a03

Browse files
dinghaoliusre
authored andcommitted
power: supply: bq24190_charger: Fix runtime PM imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu <[email protected]> Reviewed-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 7222bd6 commit 1a37a03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/power/supply/bq24190_charger.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,10 @@ static ssize_t bq24190_sysfs_store(struct device *dev,
481481
return ret;
482482

483483
ret = pm_runtime_get_sync(bdi->dev);
484-
if (ret < 0)
484+
if (ret < 0) {
485+
pm_runtime_put_noidle(bdi->dev);
485486
return ret;
487+
}
486488

487489
ret = bq24190_write_mask(bdi, info->reg, info->mask, info->shift, v);
488490
if (ret)

0 commit comments

Comments
 (0)