diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index b961a30c2a22..d360655e5deb 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -401,6 +401,7 @@ EXPORT_SYMBOL(snd_pcm_lib_malloc_pages); */ int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) { + struct snd_card *card = substream->pcm->card; struct snd_pcm_runtime *runtime; if (PCM_RUNTIME_CHECK(substream)) @@ -409,8 +410,6 @@ int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) if (runtime->dma_area == NULL) return 0; if (runtime->dma_buffer_p != &substream->dma_buffer) { - struct snd_card *card = substream->pcm->card; - /* it's a newly allocated buffer. release it now. */ do_free_pages(card, runtime->dma_buffer_p); kfree(runtime->dma_buffer_p);