All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH - alsa-lib 0/1] pcm_file add missing unlock
@ 2019-05-23  9:44 Adam Miartus
  2019-05-23  9:44 ` [PATCH - alsa-lib 1/1] pcm_file: add missing unlock on early return Adam Miartus
  2019-05-23  9:57 ` [PATCH - alsa-lib 0/1] pcm_file add missing unlock Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Adam Miartus @ 2019-05-23  9:44 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel

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(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH - alsa-lib 1/1] pcm_file: add missing unlock on early return
  2019-05-23  9:44 [PATCH - alsa-lib 0/1] pcm_file add missing unlock Adam Miartus
@ 2019-05-23  9:44 ` Adam Miartus
  2019-05-23  9:57 ` [PATCH - alsa-lib 0/1] pcm_file add missing unlock Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Adam Miartus @ 2019-05-23  9:44 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel

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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH - alsa-lib 0/1] pcm_file add missing unlock
  2019-05-23  9:44 [PATCH - alsa-lib 0/1] pcm_file add missing unlock Adam Miartus
  2019-05-23  9:44 ` [PATCH - alsa-lib 1/1] pcm_file: add missing unlock on early return Adam Miartus
@ 2019-05-23  9:57 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2019-05-23  9:57 UTC (permalink / raw)
  To: Adam Miartus; +Cc: alsa-devel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-23  9:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23  9:44 [PATCH - alsa-lib 0/1] pcm_file add missing unlock Adam Miartus
2019-05-23  9:44 ` [PATCH - alsa-lib 1/1] pcm_file: add missing unlock on early return Adam Miartus
2019-05-23  9:57 ` [PATCH - alsa-lib 0/1] pcm_file add missing unlock Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.