ALSA: pcm: Fix mmap breakage without explicit buffer setup
authorTakashi Iwai <tiwai@suse.de>
Sun, 8 Aug 2021 07:01:16 +0000 (09:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Aug 2021 12:00:26 +0000 (14:00 +0200)
commit98c3fa3a9d7a2e405ad5a656793d0117bed00881
treee9e61cec32afacf42b52966d99b0317821951b94
parentcc1a4dff23a48a3759b2b024ec62b0f34f200b4d
ALSA: pcm: Fix mmap breakage without explicit buffer setup

commit dc0dc8a73e8e4dc33fba93dfe23356cc5a500c57 upstream.

The recent fix c4824ae7db41 ("ALSA: pcm: Fix mmap capability check")
restricts the mmap capability only to the drivers that properly set up
the buffers, but it caused a regression for a few drivers that manage
the buffer on its own way.

For those with UNKNOWN buffer type (i.e. the uninitialized / unused
substream->dma_buffer), just assume that the driver handles the mmap
properly and blindly trust the hardware info bit.

Fixes: c4824ae7db41 ("ALSA: pcm: Fix mmap capability check")
Reported-and-tested-by: Jeff Woods <jwoods@fnordco.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/s5him0gpghv.wl-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/pcm_native.c