ALSA: PCM: Fix NULL dereference at mmap checks
authorTakashi Iwai <tiwai@suse.de>
Sun, 7 Nov 2021 16:39:11 +0000 (17:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:15:55 +0000 (19:15 +0100)
commit47047ae0b779bf8c2a3e18313110f2a89586e477
treed1a34eb23a39072985ee6c4bb366d11303c72142
parentb9d4a8993500dd2e95fa336c6b003a4f28880973
ALSA: PCM: Fix NULL dereference at mmap checks

commit 8e537d5dec34cac746dd6abf6a83e5de3aa471fc upstream.

The recent refactoring of mmap handling caused Oops on some devices
that don't use the standard memory allocations.  This patch addresses
it by allowing snd_dma_buffer_mmap() helper to receive the NULL
pointer dmab argument (and return an error appropriately).

Fixes: a202bd1ad86d ("ALSA: core: Move mmap handler into memalloc ops")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20211107163911.13534-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/memalloc.c