aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2009-04-20 13:15:25 +0000
committerStanislav Sedov <stas@FreeBSD.org>2009-04-20 13:15:25 +0000
commit219c5a5a9645007eee8f43b132d14dfdafbccb5e (patch)
tree0ff5b155208f7aec43bea457eb48ab4340bd07b2
parent9725389e1edcc3f4837311048afe17c8781a92d0 (diff)
downloadsrc-219c5a5a9645007eee8f43b132d14dfdafbccb5e.tar.gz
src-219c5a5a9645007eee8f43b132d14dfdafbccb5e.zip
- Unlock softc mutex on failure.
MFC after: 1 week
Notes
Notes: svn path=/head/; revision=191310
-rw-r--r--sys/dev/sound/pci/envy24ht.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/sys/dev/sound/pci/envy24ht.c b/sys/dev/sound/pci/envy24ht.c
index a9d32e1b2010..d7b034125202 100644
--- a/sys/dev/sound/pci/envy24ht.c
+++ b/sys/dev/sound/pci/envy24ht.c
@@ -1677,6 +1677,7 @@ envy24htchan_trigger(kobj_t obj, void *data, int go)
struct sc_info *sc = ch->parent;
u_int32_t ptr;
int slot;
+ int error = 0;
#if 0
int i;
@@ -1698,8 +1699,10 @@ envy24htchan_trigger(kobj_t obj, void *data, int go)
sc->caps[0].minspeed = sc->caps[0].maxspeed = sc->speed;
sc->caps[1].minspeed = sc->caps[1].maxspeed = sc->speed;
}
- else if (ch->speed != 0 && ch->speed != sc->speed)
- return -1;
+ else if (ch->speed != 0 && ch->speed != sc->speed) {
+ error = -1;
+ goto fail;
+ }
if (ch->speed == 0)
ch->channel->speed = sc->speed;
/* start or enable channel */
@@ -1729,16 +1732,20 @@ envy24htchan_trigger(kobj_t obj, void *data, int go)
#if(0)
device_printf(sc->dev, "envy24htchan_trigger(): emldmawr\n");
#endif
- if (ch->run != 1)
- return -1;
+ if (ch->run != 1) {
+ error = -1;
+ goto fail;
+ }
ch->emldma(ch);
break;
case PCMTRIG_EMLDMARD:
#if(0)
device_printf(sc->dev, "envy24htchan_trigger(): emldmard\n");
#endif
- if (ch->run != 1)
- return -1;
+ if (ch->run != 1) {
+ error = -1;
+ goto fail;
+ }
ch->emldma(ch);
break;
case PCMTRIG_ABORT:
@@ -1768,9 +1775,9 @@ envy24htchan_trigger(kobj_t obj, void *data, int go)
}
break;
}
+fail:
snd_mtxunlock(sc->lock);
-
- return 0;
+ return (error);
}
static int