summaryrefslogtreecommitdiffstats
path: root/sys/dev/mfi
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2006-06-20 23:08:35 +0000
committerps <ps@FreeBSD.org>2006-06-20 23:08:35 +0000
commitc5e80142bb7e178c526c2502b0a98233d44e65ad (patch)
tree02070e660fc0189ae4efc43a1de29e3af7b253a2 /sys/dev/mfi
parent2946fa1ebcb52cf7428a24a7a7cf12731482d083 (diff)
downloadFreeBSD-src-c5e80142bb7e178c526c2502b0a98233d44e65ad.zip
FreeBSD-src-c5e80142bb7e178c526c2502b0a98233d44e65ad.tar.gz
Fix a potential problem when mfi_get_log_state and only
release a command if one was allocated. Also release the command in mfi_shutdown.
Diffstat (limited to 'sys/dev/mfi')
-rw-r--r--sys/dev/mfi/mfi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index e2dfacd9..e46a916 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -577,7 +577,7 @@ out:
static int
mfi_get_log_state(struct mfi_softc *sc, struct mfi_evt_log_state **log_state)
{
- struct mfi_command *cm;
+ struct mfi_command *cm = NULL;
int error;
mtx_lock(&sc->mfi_io_lock);
@@ -602,7 +602,8 @@ mfi_get_log_state(struct mfi_softc *sc, struct mfi_evt_log_state **log_state)
bus_dmamap_unload(sc->mfi_buffer_dmat, cm->cm_dmamap);
out:
- mfi_release_command(cm);
+ if (cm)
+ mfi_release_command(cm);
mtx_unlock(&sc->mfi_io_lock);
return (error);
@@ -822,6 +823,7 @@ mfi_shutdown(struct mfi_softc *sc)
device_printf(sc->mfi_dev, "Failed to shutdown controller\n");
}
+ mfi_release_command(cm);
return (error);
}
OpenPOWER on IntegriCloud