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

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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;