aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/sof
diff options
context:
space:
mode:
authorPeter Ujfalusi2023-09-15 15:40:15 +0300
committerGreg Kroah-Hartman2023-10-06 14:56:37 +0200
commit16fd3c37d1cabdab3d5f6398787dad6822adcee2 (patch)
treec191e6a7ec67eefeabd9428d6a0d4106b3a1c85a /sound/soc/sof
parent211aac2ef6fffab208df8cc386f997dca8c2b85a (diff)
ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful
[ Upstream commit 31bb7bd9ffee50d09ec931998b823a86132ab807 ] All the fail paths during probe will free up the ops, on remove we should only free it if the probe was successful. Fixes: bc433fd76fae ("ASoC: SOF: Add ops_free") Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Link: https://lore.kernel.org/r/20230915124015.19637-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r--sound/soc/sof/core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 75a1e2c6539f..eaa16755a270 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -461,10 +461,9 @@ int snd_sof_device_remove(struct device *dev)
snd_sof_ipc_free(sdev);
snd_sof_free_debug(sdev);
snd_sof_remove(sdev);
+ sof_ops_free(sdev);
}
- sof_ops_free(sdev);
-
/* release firmware */
snd_sof_fw_unload(sdev);