summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/core/memalloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c
index ea778f868cf3..ea9698cea2e3 100644
--- a/sound/core/memalloc.c
+++ b/sound/core/memalloc.c
@@ -631,6 +631,8 @@ static const struct snd_malloc_ops *dma_ops[] = {
static const struct snd_malloc_ops *snd_dma_get_ops(struct snd_dma_buffer *dmab)
{
+ if (WARN_ON_ONCE(!dmab))
+ return NULL;
if (WARN_ON_ONCE(dmab->dev.type <= SNDRV_DMA_TYPE_UNKNOWN ||
dmab->dev.type >= ARRAY_SIZE(dma_ops)))
return NULL;