diff options
author | 2020-10-15 13:22:12 +0000 | |
---|---|---|
committer | 2020-10-15 13:22:12 +0000 | |
commit | a83ec2865aeaeb867719080e00ad0ac9752d01cc (patch) | |
tree | 82ad3a6719ecd9fda92c46891410f2a90c0541e3 /sys/dev/sdmmc | |
parent | Nuke commented out variable declaration. (diff) | |
download | wireguard-openbsd-a83ec2865aeaeb867719080e00ad0ac9752d01cc.tar.xz wireguard-openbsd-a83ec2865aeaeb867719080e00ad0ac9752d01cc.zip |
Replace simple one-line bcopy()/memcpy() of faked data into scsi_xfer with call
to scsi_copy_internal_data(). Thus getting xs->resid properly set and adding the
usual uio/size sanity checks.
Diffstat (limited to 'sys/dev/sdmmc')
-rw-r--r-- | sys/dev/sdmmc/sdmmc_scsi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/sdmmc/sdmmc_scsi.c b/sys/dev/sdmmc/sdmmc_scsi.c index 0b7ffa260a9..d2ac99671e6 100644 --- a/sys/dev/sdmmc/sdmmc_scsi.c +++ b/sys/dev/sdmmc/sdmmc_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_scsi.c,v 1.58 2020/09/22 19:32:53 krw Exp $ */ +/* $OpenBSD: sdmmc_scsi.c,v 1.59 2020/10/15 13:22:13 krw Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -443,7 +443,7 @@ sdmmc_inquiry(struct scsi_xfer *xs) memcpy(inq.product, product, sizeof(inq.product)); memcpy(inq.revision, revision, sizeof(inq.revision)); - memcpy(xs->data, &inq, MIN(xs->datalen, sizeof(inq))); + scsi_copy_internal_data(xs, &inq, sizeof(inq)); done: scsi_done(xs); |