Skip to content

Commit da0fe8f

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: pcm: 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 <[email protected] Reviewed-by: Daniel Baluta <[email protected] Reviewed-by: Ranjani Sridharan <[email protected] Signed-off-by: Peter Ujfalusi <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent 3de9758 commit da0fe8f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sound/soc/sof/pcm.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,16 +643,17 @@ static int sof_pcm_probe(struct snd_soc_component *component)
643643
"%s/%s",
644644
plat_data->tplg_filename_prefix,
645645
plat_data->tplg_filename);
646-
if (!tplg_filename)
647-
return -ENOMEM;
646+
if (!tplg_filename) {
647+
ret = -ENOMEM;
648+
goto pm_error;
649+
}
648650

649651
ret = snd_sof_load_topology(component, tplg_filename);
650-
if (ret < 0) {
652+
if (ret < 0)
651653
dev_err(component->dev, "error: failed to load DSP topology %d\n",
652654
ret);
653-
return ret;
654-
}
655655

656+
pm_error:
656657
pm_runtime_mark_last_busy(component->dev);
657658
pm_runtime_put_autosuspend(component->dev);
658659

0 commit comments

Comments
 (0)