summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2017-02-02 03:47:42 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2017-02-02 03:47:42 +0000
commitad63cd4159e72b4a5451f9d6d333ebf1fc6b3283 (patch)
treeb237404f1edc0d4d0a6dfb5f63057d915863425c /sys/dev/ic
parentfb49cf423951f95ff99ade132f8ef9c7d3ec599e (diff)
copy the mbox into the dcmd struct, not the pointer to the mbox.
makes bioctl work on mfi(4) again. while here memset a few mboxes before using them. bioctl breakage reported by jason george
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/mfi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index e6c2ff0e2d3..6950d46b7ed 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.166 2017/01/23 01:10:31 dlg Exp $ */
+/* $OpenBSD: mfi.c,v 1.167 2017/02/02 03:47:41 dlg Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -1378,7 +1378,7 @@ mfi_do_mgmt(struct mfi_softc *sc, struct mfi_ccb *ccb, uint32_t opc,
/* handle special opcodes */
if (mbox != NULL)
- memcpy(&dcmd->mdf_mbox, &mbox, sizeof(dcmd->mdf_mbox));
+ memcpy(&dcmd->mdf_mbox, mbox, sizeof(dcmd->mdf_mbox));
if (dir != MFI_DATA_NONE) {
if (dir == MFI_DATA_OUT)
@@ -1460,6 +1460,7 @@ mfi_ioctl_cache(struct scsi_link *link, u_long cmd, struct dk_cache *dc)
goto done;
}
+ memset(&mbox, 0, sizeof(mbox));
mbox.b[0] = link->target;
if ((rv = mfi_mgmt(sc, MR_DCMD_LD_GET_PROPERTIES, MFI_DATA_IN,
sizeof(ldp), &ldp, &mbox)) != 0)
@@ -1486,6 +1487,7 @@ mfi_ioctl_cache(struct scsi_link *link, u_long cmd, struct dk_cache *dc)
((dc->rdcache) ? 1 : 0) == rdenable)
goto done;
+ memset(&mbox, 0, sizeof(mbox));
mbox.b[0] = ldp.mlp_ld.mld_target;
mbox.b[1] = ldp.mlp_ld.mld_res;
mbox.s[1] = ldp.mlp_ld.mld_seq;