From: Takashi Sakamoto Date: Tue, 10 Sep 2019 13:51:51 +0000 (+0900) Subject: ALSA: firewire-tascam: handle error code when getting current source of clock X-Git-Tag: v5.15~5427^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2617120f4de6d0423384e0e86b14c78b9de84d5a;p=platform%2Fkernel%2Flinux-starfive.git ALSA: firewire-tascam: handle error code when getting current source of clock 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: # v4.4+ Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20190910135152.29800-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai --- diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c index b5ced54..2377732 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)) {