Skip to content

Commit 217f5e0

Browse files
krzkvinodkoul
authored andcommitted
soundwire: debugfs: fix unbalanced pm_runtime_put()
If pm_runtime_resume_and_get() failed with -EACCES, the driver continued execution and finally called pm_runtime_put_autosuspend(). Since pm_runtime_resume_and_get() drops the usage counter on every error, this lead to double decrement of that counter. Fixes: b275bf4 ("soundwire: debugfs: Switch to sdw_read_no_pm") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20230517163750.997629-2-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 9f9914b commit 217f5e0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/soundwire/debugfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ static int sdw_slave_reg_show(struct seq_file *s_file, void *data)
5656
if (!buf)
5757
return -ENOMEM;
5858

59-
ret = pm_runtime_resume_and_get(&slave->dev);
59+
ret = pm_runtime_get_sync(&slave->dev);
6060
if (ret < 0 && ret != -EACCES) {
61+
pm_runtime_put_noidle(&slave->dev);
6162
kfree(buf);
6263
return ret;
6364
}

0 commit comments

Comments
 (0)