summaryrefslogtreecommitdiff
path: root/sys/dev/ic/mpi.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-05-16 20:34:00 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-05-16 20:34:00 +0000
commitb9313931c23fbd6b43ee9ab25d569edd9d09ca6f (patch)
tree58482aa4f422225e61152f67bffcf89b625e69cc /sys/dev/ic/mpi.c
parentbfe5e634b33fca91e0e7192bd901dcbe3d0dfc79 (diff)
Use a temporary variable for now to sidestep -Wbounded checking when
copying vendor[8]/product[16]/revision[4] out of struct scsi_inquiry_data together with one memcopy. ok krw
Diffstat (limited to 'sys/dev/ic/mpi.c')
-rw-r--r--sys/dev/ic/mpi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index c097a5a443b..786eaf680e1 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.147 2010/05/09 22:03:56 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.148 2010/05/16 20:33:59 nicm Exp $ */
/*
* Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org>
@@ -2832,6 +2832,7 @@ mpi_ioctl_vol(struct mpi_softc *sc, struct bioc_vol *bv)
struct device *dev;
struct scsi_link *link;
struct mpi_cfg_raid_vol_pg0 *rpg0;
+ char *vendp;
id = bv->bv_volid;
if (mpi_bio_get_pg0_raid(sc, id))
@@ -2905,8 +2906,8 @@ mpi_ioctl_vol(struct mpi_softc *sc, struct bioc_vol *bv)
/* are we it? */
if (vol == bv->bv_volid) {
dev = link->device_softc;
- memcpy(bv->bv_vendor, link->inqdata.vendor,
- sizeof bv->bv_vendor);
+ vendp = link->inqdata.vendor;
+ memcpy(bv->bv_vendor, vendp, sizeof bv->bv_vendor);
bv->bv_vendor[sizeof(bv->bv_vendor) - 1] = '\0';
strlcpy(bv->bv_dev, dev->dv_xname, sizeof bv->bv_dev);
break;