ALSA: core: Don't allow NULL device for memory allocation

Since we covered all callers with NULL device pointer, let's catch the
remaining calls with NULL and warn explicitly.

Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2019-02-04 14:34:00 +01:00
parent 8f74ae398a
commit 6ce1d63ed7

View file

@ -182,6 +182,8 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
return -ENXIO;
if (WARN_ON(!dmab))
return -ENXIO;
if (WARN_ON(!device))
return -EINVAL;
dmab->dev.type = type;
dmab->dev.dev = device;