Don't leak mutex on open failure.

This commit is contained in:
Poul-Henning Kamp 2005-04-04 17:37:35 +00:00
parent 15785fbe81
commit a877d4a4e9

View File

@ -177,8 +177,10 @@ gpib_l_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
u = dev->si_drv1;
mtx_lock(&u->mutex);
if (u->busy)
if (u->busy) {
mtx_unlock(&u->mutex);
return (EBUSY);
}
u->busy = 1;
u->irq = gpib_l_irq;
mtx_unlock(&u->mutex);