Commit 6ce1d63e authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8f74ae39
...@@ -182,6 +182,8 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size, ...@@ -182,6 +182,8 @@ int snd_dma_alloc_pages(int type, struct device *device, size_t size,
return -ENXIO; return -ENXIO;
if (WARN_ON(!dmab)) if (WARN_ON(!dmab))
return -ENXIO; return -ENXIO;
if (WARN_ON(!device))
return -EINVAL;
dmab->dev.type = type; dmab->dev.type = type;
dmab->dev.dev = device; dmab->dev.dev = device;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment