]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: amd: Avoid passing NULL to memory allocators
authorTakashi Iwai <tiwai@suse.de>
Mon, 4 Feb 2019 13:27:01 +0000 (14:27 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 5 Feb 2019 10:04:57 +0000 (11:04 +0100)
We should pass a proper non-NULL device object to memory allocators
although it was accepted in the past.  The card->dev points to the
most appropriate device object in such a case, so let's put it.

Acked-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/soc/amd/raven/acp3x-pcm-dma.c

index 3d58338fa3cf79b3d9c28351cfd9411167fe51a5..3e7d4099364cb85792ec616a2ac9f85c6777791d 100644 (file)
@@ -369,7 +369,8 @@ static int acp3x_dma_new(struct snd_soc_pcm_runtime *rtd)
 {
        return snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,
                                                     SNDRV_DMA_TYPE_DEV,
-                                                    NULL, MIN_BUFFER,
+                                                    rtd->pcm->card->dev,
+                                                    MIN_BUFFER,
                                                     MAX_BUFFER);
 }