- Properly unlock mutex on failure in channel_trigger. Before this
the function just returned with the mutex held. MFC after: 1 week
This commit is contained in:
parent
588e47016e
commit
a780a09a2b
@ -1766,6 +1766,7 @@ envy24chan_trigger(kobj_t obj, void *data, int go)
|
|||||||
struct sc_info *sc = ch->parent;
|
struct sc_info *sc = ch->parent;
|
||||||
u_int32_t ptr;
|
u_int32_t ptr;
|
||||||
int slot;
|
int slot;
|
||||||
|
int error = 0;
|
||||||
#if 0
|
#if 0
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1787,8 +1788,10 @@ envy24chan_trigger(kobj_t obj, void *data, int go)
|
|||||||
sc->caps[0].minspeed = sc->caps[0].maxspeed = sc->speed;
|
sc->caps[0].minspeed = sc->caps[0].maxspeed = sc->speed;
|
||||||
sc->caps[1].minspeed = sc->caps[1].maxspeed = sc->speed;
|
sc->caps[1].minspeed = sc->caps[1].maxspeed = sc->speed;
|
||||||
}
|
}
|
||||||
else if (ch->speed != 0 && ch->speed != sc->speed)
|
else if (ch->speed != 0 && ch->speed != sc->speed) {
|
||||||
return -1;
|
error = -1;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
if (ch->speed == 0)
|
if (ch->speed == 0)
|
||||||
ch->channel->speed = sc->speed;
|
ch->channel->speed = sc->speed;
|
||||||
/* start or enable channel */
|
/* start or enable channel */
|
||||||
@ -1818,16 +1821,20 @@ envy24chan_trigger(kobj_t obj, void *data, int go)
|
|||||||
#if(0)
|
#if(0)
|
||||||
device_printf(sc->dev, "envy24chan_trigger(): emldmawr\n");
|
device_printf(sc->dev, "envy24chan_trigger(): emldmawr\n");
|
||||||
#endif
|
#endif
|
||||||
if (ch->run != 1)
|
if (ch->run != 1) {
|
||||||
return -1;
|
error = -1;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
ch->emldma(ch);
|
ch->emldma(ch);
|
||||||
break;
|
break;
|
||||||
case PCMTRIG_EMLDMARD:
|
case PCMTRIG_EMLDMARD:
|
||||||
#if(0)
|
#if(0)
|
||||||
device_printf(sc->dev, "envy24chan_trigger(): emldmard\n");
|
device_printf(sc->dev, "envy24chan_trigger(): emldmard\n");
|
||||||
#endif
|
#endif
|
||||||
if (ch->run != 1)
|
if (ch->run != 1) {
|
||||||
return -1;
|
error = -1;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
ch->emldma(ch);
|
ch->emldma(ch);
|
||||||
break;
|
break;
|
||||||
case PCMTRIG_ABORT:
|
case PCMTRIG_ABORT:
|
||||||
@ -1859,9 +1866,9 @@ envy24chan_trigger(kobj_t obj, void *data, int go)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
fail:
|
||||||
snd_mtxunlock(sc->lock);
|
snd_mtxunlock(sc->lock);
|
||||||
|
return (error);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user