From: Peter Ujfalusi Date: Fri, 15 Sep 2023 12:40:15 +0000 (+0300) Subject: ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful X-Git-Tag: v6.6.17~3724^2~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31bb7bd9ffee50d09ec931998b823a86132ab807;p=platform%2Fkernel%2Flinux-rpi.git ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was successful 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 Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20230915124015.19637-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 30db685..2d1616b 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -486,10 +486,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);