[alsa-devel] [PATCH - alsa-lib 0/1] pcm_file add missing unlock
previous patches: pcm: file: add support for infile reading in non interleaved mode pcm: file: use snd_pcm_file_areas_read_infile for readi
introduced an issue where pcm would not be unlocked on early return
Adam Miartus (1): pcm_file: add missing unlock on early return
src/pcm/pcm_file.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Signed-off-by: Adam Miartus amiartus@de.adit-jv.com
diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c index dcaa41d..8e2c70b 100644 --- a/src/pcm/pcm_file.c +++ b/src/pcm/pcm_file.c @@ -584,8 +584,10 @@ static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pc __snd_pcm_lock(pcm);
frames = _snd_pcm_readi(file->gen.slave, buffer, size); - if (frames <= 0) + if (frames <= 0) { + __snd_pcm_unlock(pcm); return frames; + }
snd_pcm_areas_from_buf(pcm, areas, buffer); snd_pcm_file_areas_read_infile(pcm, areas, 0, frames); @@ -605,8 +607,10 @@ static snd_pcm_sframes_t snd_pcm_file_readn(snd_pcm_t *pcm, void **bufs, snd_pcm
__snd_pcm_lock(pcm); frames = _snd_pcm_readn(file->gen.slave, bufs, size); - if (frames <= 0) + if (frames <= 0) { + __snd_pcm_unlock(pcm); return frames; + }
snd_pcm_areas_from_bufs(pcm, areas, bufs); snd_pcm_file_areas_read_infile(pcm, areas, 0, frames);
On Thu, 23 May 2019 11:44:29 +0200, Adam Miartus wrote:
previous patches: pcm: file: add support for infile reading in non interleaved mode pcm: file: use snd_pcm_file_areas_read_infile for readi
introduced an issue where pcm would not be unlocked on early return
Adam Miartus (1): pcm_file: add missing unlock on early return
Applied, thanks.
BTW, you don't need a cover letter if it's only a single patch. Put the more description in the patch itself, instead.
Takashi
participants (2)
-
Adam Miartus
-
Takashi Iwai