mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-05 13:30:00 -05:00
pcm: file: add missing unlock on early return
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
349b42f547
commit
33c7ea0865
1 changed files with 6 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue