Skip to content
Snippets Groups Projects
Commit 315d9f1b authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: pcm: Use the common error path in __snd_pcm_lib_xfer()


An open-coded error path in __snd_pcm_lib_xfer() can be replaced with
the simple goto to the common error path.  This also makes the error
handling more consistent, i.e. when some samples have been already
processed, return that size instead of the error code.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2dee43ec
No related branches found
No related tags found
No related merge requests found
...@@ -2219,9 +2219,8 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, ...@@ -2219,9 +2219,8 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
if (frames > cont) if (frames > cont)
frames = cont; frames = cont;
if (snd_BUG_ON(!frames)) { if (snd_BUG_ON(!frames)) {
runtime->twake = 0; err = -EINVAL;
snd_pcm_stream_unlock_irq(substream); goto _end_unlock;
return -EINVAL;
} }
snd_pcm_stream_unlock_irq(substream); snd_pcm_stream_unlock_irq(substream);
err = writer(substream, appl_ofs, data, offset, frames, err = writer(substream, appl_ofs, data, offset, frames,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment