From: Pierre-Louis Bossart Date: Fri, 12 May 2023 10:33:14 +0000 (+0300) Subject: ASoC: SOF: pcm: fix pm_runtime imbalance in error handling X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=da0fe8fd515a471d373acc3682bfb5522cca4d55;p=users%2Fjedix%2Flinux-maple.git 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 tplg_filename_prefix, plat_data->tplg_filename); - if (!tplg_filename) - return -ENOMEM; + if (!tplg_filename) { + ret = -ENOMEM; + goto pm_error; + } ret = snd_sof_load_topology(component, tplg_filename); - if (ret < 0) { + if (ret < 0) dev_err(component->dev, "error: failed to load DSP topology %d\n", ret); - return ret; - } +pm_error: pm_runtime_mark_last_busy(component->dev); pm_runtime_put_autosuspend(component->dev);