Skip to content

Commit

Permalink
ALSA: firewire-tascam: handle error code when getting current source …
Browse files Browse the repository at this point in the history
…of clock

The return value of snd_tscm_stream_get_clock() is ignored. This commit
checks the value and handle error.

Fixes: e453df4 ("ALSA: firewire-tascam: add PCM functionality")
Cc: <[email protected]> # v4.4+
Signed-off-by: Takashi Sakamoto <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
takaswie authored and tiwai committed Sep 10, 2019
1 parent 2a36c16 commit 2617120
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/firewire/tascam/tascam-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 2617120

Please sign in to comment.