[alsa-devel] [PATCH alsa-lib 1/1] fix: add missing "break" in "switch"

Antonio Borneo borneo.antonio at gmail.com
Sat May 12 18:06:23 CEST 2012


A missing "break" in procedure snd_pcm_write_mmap() causes
execution of "case SND_PCM_ACCESS_MMAP_NONINTERLEAVED" to
fall through next "default" case of the "switch" statement.
Since "default" handles error cases, the procedure returns
error.

The error fixed by this patch blocks transfer of capture
data from kernel to application. Execution get stuck in
alsa-lib, that discards all received data.

Signed-off-by: Antonio Borneo <borneo.antonio at gmail.com>
---
 src/pcm/pcm_mmap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/pcm/pcm_mmap.c b/src/pcm/pcm_mmap.c
index 6b44050..83e74e5 100644
--- a/src/pcm/pcm_mmap.c
+++ b/src/pcm/pcm_mmap.c
@@ -622,6 +622,7 @@ snd_pcm_sframes_t snd_pcm_read_mmap(snd_pcm_t *pcm, snd_pcm_uframes_t offset,
 			err = _snd_pcm_readn(pcm->fast_op_arg, bufs, frames);
 			if (err >= 0)
 				frames = err;
+			break;
 		}
 		default:
 			SNDMSG("invalid access type %d", pcm->access);
-- 
1.7.3.4



More information about the Alsa-devel mailing list