diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2007-12-20 21:13:58 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2007-12-20 21:13:58 +0000 |
| commit | f16627aadcd58df2abdf101dd8bce57b50cac3c2 (patch) | |
| tree | 662fbc094caf6c4e65b9edbf8f4c80d8f5eedb56 /sys | |
| parent | 889befc455b85f5b520d7f7d349dda472ae2e61e (diff) | |
Notes
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 37e13b5a1136..08ffa9e660eb 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); } |
