diff mbox series

[1/2] ALSA: firewire-tascam: handle error code when getting current source of clock

Message ID 20190910135152.29800-2-o-takashi@sakamocchi.jp (mailing list archive)
State New, archived
Headers show
Series ALSA: firewire-tascam: fix to handle error code to read status of sampling clock | expand

Commit Message

Takashi Sakamoto Sept. 10, 2019, 1:51 p.m. UTC
The return value of snd_tscm_stream_get_clock() is ignored. This commit
checks the value and handle error.

Fixes: e453df44f0d6 ("ALSA: firewire-tascam: add PCM functionality")
Cc: <stable@vger.kernel.org> # v4.4+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
---
 sound/firewire/tascam/tascam-pcm.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Takashi Iwai Sept. 10, 2019, 2:17 p.m. UTC | #1
On Tue, 10 Sep 2019 15:51:51 +0200,
Takashi Sakamoto wrote:
> 
> The return value of snd_tscm_stream_get_clock() is ignored. This commit
> checks the value and handle error.
> 
> Fixes: e453df44f0d6 ("ALSA: firewire-tascam: add PCM functionality")
> Cc: <stable@vger.kernel.org> # v4.4+
> Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

Applied, thanks.


Takashi
diff mbox series

Patch

diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c
index b5ced5415e40..2377732caa52 100644
--- a/sound/firewire/tascam/tascam-pcm.c
+++ b/sound/firewire/tascam/tascam-pcm.c
@@ -56,6 +56,9 @@  static int pcm_open(struct snd_pcm_substream *substream)
 		goto err_locked;
 
 	err = snd_tscm_stream_get_clock(tscm, &clock);
+	if (err < 0)
+		goto err_locked;
+
 	if (clock != SND_TSCM_CLOCK_INTERNAL ||
 	    amdtp_stream_pcm_running(&tscm->rx_stream) ||
 	    amdtp_stream_pcm_running(&tscm->tx_stream)) {