summaryrefslogtreecommitdiffstats
path: root/sys/dev/mfi
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2006-04-10 06:44:30 +0000
committerscottl <scottl@FreeBSD.org>2006-04-10 06:44:30 +0000
commit58e620778689846c21bd22beab799502586a43ac (patch)
treefb35f02850ba2f9e517e913d459289da8efcb0bb /sys/dev/mfi
parent0b8fbed4ea5b265509657fd7f94aef1ef49ddcf6 (diff)
downloadFreeBSD-src-58e620778689846c21bd22beab799502586a43ac.zip
FreeBSD-src-58e620778689846c21bd22beab799502586a43ac.tar.gz
Fix some small bugs.
Submitted by: pjd Found by: Coverity Prevent (tm)
Diffstat (limited to 'sys/dev/mfi')
-rw-r--r--sys/dev/mfi/mfi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 073a0f5..c4cc8f2 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -715,7 +715,9 @@ mfi_ldprobe_inq(struct mfi_softc *sc)
break;
cm = mfi_dequeue_free(sc);
if (cm == NULL) {
- tsleep(mfi_startup, 0, "mfistart", 5 * hz);
+ free(inq, M_MFIBUF);
+ msleep(mfi_startup, &sc->mfi_io_lock, 0, "mfistart",
+ 5 * hz);
i--;
continue;
}
@@ -840,8 +842,10 @@ mfi_ldprobe_capacity(struct mfi_softc *sc, int id)
if (cap == NULL)
return (ENOMEM);
cm = mfi_dequeue_free(sc);
- if (cm == NULL)
+ if (cm == NULL) {
+ free(cap, M_MFIBUF);
return (EBUSY);
+ }
pass = &cm->cm_frame->pass;
pass->header.cmd = MFI_CMD_LD_SCSI_IO;
pass->header.target_id = id;
@@ -925,6 +929,7 @@ mfi_add_ld(struct mfi_softc *sc, int id, uint64_t sectors, uint32_t secsize)
if ((child = device_add_child(sc->mfi_dev, "mfid", -1)) == NULL) {
device_printf(sc->mfi_dev, "Failed to add logical disk\n");
+ free(ld, M_MFIBUF);
return (EINVAL);
}
OpenPOWER on IntegriCloud