Skip to content

Commit

Permalink
ASoC: SOF: core: Only call sof_ops_free() on remove if the probe was …
Browse files Browse the repository at this point in the history
…successful

[ Upstream commit 31bb7bd ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ujfalusi authored and gregkh committed Oct 6, 2023
1 parent 211aac2 commit 16fd3c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 16fd3c3

Please sign in to comment.