All of lore.kernel.org
 help / color / mirror / Atom feed
From: <twischer@de.adit-jv.com>
To: patch@alsa-project.org, tiwai@suse.de
Cc: Timo Wischer <twischer@de.adit-jv.com>, alsa-devel@alsa-project.org
Subject: [PATCH - PCM rate v2 1/1] pcm: rate: Add error check for snd_pcm_avail_update()
Date: Wed, 4 Jul 2018 15:39:49 +0200	[thread overview]
Message-ID: <1530711589-3919-1-git-send-email-twischer@de.adit-jv.com> (raw)

From: Timo Wischer <twischer@de.adit-jv.com>

Without these changes a negative error code returned by
snd_pcm_avail_update() will be not handled correctly.

With this patch the returned error code of snd_pcm_avail_update() will be
returned by snd_pcm_rate_avail_update().

Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
---
Compared to v1[1] of this patch only the changelog and the subject has changed.

[1] http://mailman.alsa-project.org/pipermail/alsa-devel/2018-July/137838.html

diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 4e0c7ca..031a43d 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -970,9 +970,12 @@ static snd_pcm_sframes_t snd_pcm_rate_avail_update(snd_pcm_t *pcm)
 {
 	snd_pcm_rate_t *rate = pcm->private_data;
 	snd_pcm_t *slave = rate->gen.slave;
-	snd_pcm_uframes_t slave_size;
+	snd_pcm_sframes_t slave_size;
 
 	slave_size = snd_pcm_avail_update(slave);
+	if (slave_size < 0)
+		return slave_size;
+
 	if (pcm->stream == SND_PCM_STREAM_CAPTURE)
 		goto _capture;
 	snd_pcm_rate_sync_hwptr(pcm);
-- 
2.7.4

             reply	other threads:[~2018-07-04 13:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-04 13:39 twischer [this message]
2018-07-04 13:42 ` [PATCH - PCM rate v2 1/1] pcm: rate: Add error check for snd_pcm_avail_update() Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1530711589-3919-1-git-send-email-twischer@de.adit-jv.com \
    --to=twischer@de.adit-jv.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=patch@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.