diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/aac/aac.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 37e13b5a..08ffa9e 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -3017,6 +3017,7 @@ aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib) M_NOWAIT | M_ZERO); if (event == NULL) { error = EBUSY; + mtx_unlock(&sc->aac_io_lock); goto out; } event->ev_type = AAC_EVENT_CMFREE; @@ -3048,12 +3049,13 @@ aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib) * Pass the FIB to the controller, wait for it to complete. */ mtx_lock(&sc->aac_io_lock); - if ((error = aac_wait_command(cm)) != 0) { + error = aac_wait_command(cm); + mtx_unlock(&sc->aac_io_lock); + if (error != 0) { device_printf(sc->aac_dev, "aac_wait_command return %d\n", error); goto out; } - mtx_unlock(&sc->aac_io_lock); /* * Copy the FIB and data back out to the caller. @@ -3065,14 +3067,13 @@ aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib) size = sizeof(struct aac_fib); } error = copyout(cm->cm_fib, ufib, size); - mtx_lock(&sc->aac_io_lock); out: if (cm != NULL) { + mtx_lock(&sc->aac_io_lock); aac_release_command(cm); + mtx_unlock(&sc->aac_io_lock); } - - mtx_unlock(&sc->aac_io_lock); return(error); } |