Skip to content

Commit bc42427

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling
When an error occurs, we need to make sure the device can pm_runtime suspend instead of keeping it active. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com Link: https://lore.kernel.org/r/20230512103315.8921-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org
1 parent da0fe8f commit bc42427

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

sound/soc/sof/sof-client-probes.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,7 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
218218

219219
ret = ipc->points_info(cdev, &desc, &num_desc);
220220
if (ret < 0)
221-
goto exit;
222-
223-
pm_runtime_mark_last_busy(dev);
224-
err = pm_runtime_put_autosuspend(dev);
225-
if (err < 0)
226-
dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);
221+
goto pm_error;
227222

228223
for (i = 0; i < num_desc; i++) {
229224
offset = strlen(buf);
@@ -241,6 +236,13 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
241236
ret = simple_read_from_buffer(to, count, ppos, buf, strlen(buf));
242237

243238
kfree(desc);
239+
240+
pm_error:
241+
pm_runtime_mark_last_busy(dev);
242+
err = pm_runtime_put_autosuspend(dev);
243+
if (err < 0)
244+
dev_err_ratelimited(dev, "debugfs read failed to idle %d\n", err);
245+
244246
exit:
245247
kfree(buf);
246248
return ret;

0 commit comments

Comments
 (0)