]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: sh: Avoid passing NULL to memory allocators
authorTakashi Iwai <tiwai@suse.de>
Mon, 4 Feb 2019 13:27:17 +0000 (14:27 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 5 Feb 2019 10:05:20 +0000 (11:05 +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/sh/siu_pcm.c

index e263757e4a69153695ce6366769007339461b3b5..23384c477740cb62f328da7c8deaab409f731d3c 100644 (file)
@@ -542,7 +542,7 @@ static int siu_pcm_new(struct snd_soc_pcm_runtime *rtd)
                        return ret;
 
                ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
-                               SNDRV_DMA_TYPE_DEV, NULL,
+                               SNDRV_DMA_TYPE_DEV, card->dev,
                                SIU_BUFFER_BYTES_MAX, SIU_BUFFER_BYTES_MAX);
                if (ret < 0) {
                        dev_err(card->dev,