Skip to content

Commit 31bb7bd

Browse files
ujfalusibroonie
authored andcommitted
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: bc433fd ("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>
1 parent e0f9624 commit 31bb7bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sound/soc/sof/core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,9 @@ int snd_sof_device_remove(struct device *dev)
486486
snd_sof_ipc_free(sdev);
487487
snd_sof_free_debug(sdev);
488488
snd_sof_remove(sdev);
489+
sof_ops_free(sdev);
489490
}
490491

491-
sof_ops_free(sdev);
492-
493492
/* release firmware */
494493
snd_sof_fw_unload(sdev);
495494

0 commit comments

Comments
 (0)