projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8f74ae3
)
ALSA: core: Don't allow NULL device for memory allocation
author
Takashi Iwai
<tiwai@suse.de>
Mon, 4 Feb 2019 13:34:00 +0000
(14:34 +0100)
committer
Takashi Iwai
<tiwai@suse.de>
Tue, 5 Feb 2019 10:05:26 +0000
(11:05 +0100)
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>
sound/core/memalloc.c
patch
|
blob
|
history
diff --git
a/sound/core/memalloc.c
b/sound/core/memalloc.c
index
59a4adc
..
eb97423
100644
(file)
--- a/
sound/core/memalloc.c
+++ b/
sound/core/memalloc.c
@@
-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;