aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireface/ff-pcm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-09-04 10:10:27 +0200
committerTakashi Iwai <tiwai@suse.de>2017-09-04 10:10:27 +0200
commit2a32a4d9c9cc4141abdf8e90f0cd167a614c9e91 (patch)
tree1cd995a5f989c879d3d71566a1fa2db9745c5263 /sound/firewire/fireface/ff-pcm.c
parentALSA: hda: Fix regression of hdmi eld control created based on invalid pcm (diff)
parentALSA: ctxfi: Remove null check before kfree (diff)
downloadlinux-dev-2a32a4d9c9cc4141abdf8e90f0cd167a614c9e91.tar.xz
linux-dev-2a32a4d9c9cc4141abdf8e90f0cd167a614c9e91.zip
Merge branch 'for-next' into for-linus
Diffstat (limited to 'sound/firewire/fireface/ff-pcm.c')
-rw-r--r--sound/firewire/fireface/ff-pcm.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/firewire/fireface/ff-pcm.c b/sound/firewire/fireface/ff-pcm.c
index d12a0e3a4219..e3c16308363d 100644
--- a/sound/firewire/fireface/ff-pcm.c
+++ b/sound/firewire/fireface/ff-pcm.c
@@ -138,16 +138,12 @@ static int pcm_open(struct snd_pcm_substream *substream)
return err;
err = pcm_init_hw_params(ff, substream);
- if (err < 0) {
- snd_ff_stream_lock_release(ff);
- return err;
- }
+ if (err < 0)
+ goto release_lock;
err = ff->spec->protocol->get_clock(ff, &rate, &src);
- if (err < 0) {
- snd_ff_stream_lock_release(ff);
- return err;
- }
+ if (err < 0)
+ goto release_lock;
if (src != SND_FF_CLOCK_SRC_INTERNAL) {
for (i = 0; i < CIP_SFC_COUNT; ++i) {
@@ -159,8 +155,8 @@ static int pcm_open(struct snd_pcm_substream *substream)
* streaming engine can't support.
*/
if (i >= CIP_SFC_COUNT) {
- snd_ff_stream_lock_release(ff);
- return -EIO;
+ err = -EIO;
+ goto release_lock;
}
substream->runtime->hw.rate_min = rate;
@@ -177,6 +173,10 @@ static int pcm_open(struct snd_pcm_substream *substream)
snd_pcm_set_sync(substream);
return 0;
+
+release_lock:
+ snd_ff_stream_lock_release(ff);
+ return err;
}
static int pcm_close(struct snd_pcm_substream *substream)