]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: arm: Avoid passing NULL to memory allocators
authorTakashi Iwai <tiwai@suse.de>
Mon, 4 Feb 2019 13:26:27 +0000 (14:26 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 4 Feb 2019 15:51:46 +0000 (16:51 +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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/arm/aaci.c

index 0c3f073e2600eb51d723f8f9aca40c0e8d04129b..a2d4b41096e019583c920c023678d782fe4db5d3 100644 (file)
@@ -941,7 +941,8 @@ static int aaci_init_pcm(struct aaci *aaci)
                snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &aaci_playback_ops);
                snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &aaci_capture_ops);
                snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
-                                                     NULL, 0, 64 * 1024);
+                                                     aaci->card->dev,
+                                                     0, 64 * 1024);
        }
 
        return ret;