diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2019-09-10 16:51:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 13:27:51 +0300 |
commit | 02842b98ab1ea2f00c3f0a0c5eeb0776ee4bed0d (patch) | |
tree | 17bedb5da721fd59e87bd86eef997bff1e4c3f32 /sound | |
parent | e875c35b74ac5b5e89ca6933bdd5d8a5e6d5fbf0 (diff) | |
download | linux-02842b98ab1ea2f00c3f0a0c5eeb0776ee4bed0d.tar.xz |
ALSA: firewire-tascam: handle error code when getting current source of clock
commit 2617120f4de6d0423384e0e86b14c78b9de84d5a upstream.
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>
Link: https://lore.kernel.org/r/20190910135152.29800-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/firewire/tascam/tascam-pcm.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c index 380d3db969a5..64edb44d74f6 100644 --- a/sound/firewire/tascam/tascam-pcm.c +++ b/sound/firewire/tascam/tascam-pcm.c @@ -81,6 +81,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)) { |