This is a note to let you know that I've just added the patch titled ALSA: memalloc: Catch call with NULL snd_dma_buffer pointer to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: alsa-memalloc-catch-call-with-null-snd_dma_buffer-po.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit d4533fcc7b1628350fca4a94519ce718acb166a3 Author: Takashi Iwai <tiwai@xxxxxxx> Date: Fri Nov 5 11:21:03 2021 +0100 ALSA: memalloc: Catch call with NULL snd_dma_buffer pointer [ Upstream commit dce9446192439eaac81c21f517325fb473735e53 ] Although we've covered all calls with NULL dma buffer pointer, so far, there may be still some else in the wild. For catching such a case more easily, add a WARN_ON_ONCE() in snd_dma_get_ops(). Fixes: 37af81c5998f ("ALSA: core: Abstract memory alloc helpers") Link: https://lore.kernel.org/r/20211105102103.28148-1-tiwai@xxxxxxx Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index 0b8a1c3eae1b4..2d842982576bb 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -494,6 +494,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;