diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index c7c943c661e6..0b8a1c3eae1b 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -176,8 +176,11 @@ EXPORT_SYMBOL_GPL(snd_devm_alloc_pages); int snd_dma_buffer_mmap(struct snd_dma_buffer *dmab, struct vm_area_struct *area) { - const struct snd_malloc_ops *ops = snd_dma_get_ops(dmab); + const struct snd_malloc_ops *ops; + if (!dmab) + return -ENOENT; + ops = snd_dma_get_ops(dmab); if (ops && ops->mmap) return ops->mmap(dmab, area); else