Skip to content

Commit

Permalink
ASoC: SOF: pcm: topology_free should not be done on pcm_free
Browse files Browse the repository at this point in the history
pcm_free is called for each BE, which results in the topology being
freed multiple times.

The topology_free should only be done on pcm_remove to mirror the
topology_load done on pcm_probe.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
  • Loading branch information
plbossart committed Nov 30, 2018
1 parent 1f5974a commit 1ba6eed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound/soc/sof/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,6 @@ static void sof_pcm_free(struct snd_pcm *pcm)
if (spcm->pcm.capture)
snd_dma_free_pages(&spcm->stream[SNDRV_PCM_STREAM_CAPTURE].page_table);

snd_sof_free_topology(sdev);
}

/* fixup the BE DAI link to match any values from topology */
Expand Down Expand Up @@ -716,7 +715,12 @@ static int sof_pcm_probe(struct snd_soc_component *component)

static void sof_pcm_remove(struct snd_soc_component *component)
{
struct snd_sof_dev *sdev =
snd_soc_component_get_drvdata(component);

pm_runtime_disable(component->dev);
snd_sof_free_topology(sdev);

}

void snd_sof_new_platform_drv(struct snd_sof_dev *sdev)
Expand Down

0 comments on commit 1ba6eed

Please sign in to comment.