diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-02-17 18:38:32 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-02-17 18:38:32 +0000 |
commit | 01ab9635b8a1f49e9d951f2219c57ac497b9b602 (patch) | |
tree | bdee805f806faeabb2d9a7b1bbe279cc5617340b /sys/crypto/cryptodev.c | |
parent | 37bebd332a075c1a710b1e90654b173cb0aaf749 (diff) |
The loop here preparing the uio always added the length of the first
iovec, not the correct one. It worked ok since iovcnt was always 1.
Since it's unlikely to be any other number, remove the loop and just add
the one length we care about.
"go ahead" deraadt@.
Diffstat (limited to 'sys/crypto/cryptodev.c')
-rw-r--r-- | sys/crypto/cryptodev.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/crypto/cryptodev.c b/sys/crypto/cryptodev.c index 9891f790937..ca0205c709c 100644 --- a/sys/crypto/cryptodev.c +++ b/sys/crypto/cryptodev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptodev.c,v 1.68 2008/06/09 16:07:00 djm Exp $ */ +/* $OpenBSD: cryptodev.c,v 1.69 2009/02/17 18:38:31 oga Exp $ */ /* * Copyright (c) 2001 Theo de Raadt @@ -321,7 +321,6 @@ cryptodev_op(struct csession *cse, struct crypt_op *cop, struct proc *p) bzero(&cse->uio, sizeof(cse->uio)); cse->uio.uio_iovcnt = 1; - cse->uio.uio_resid = 0; cse->uio.uio_segflg = UIO_SYSSPACE; cse->uio.uio_rw = UIO_WRITE; cse->uio.uio_procp = p; @@ -329,8 +328,7 @@ cryptodev_op(struct csession *cse, struct crypt_op *cop, struct proc *p) bzero(&cse->iovec, sizeof(cse->iovec)); cse->uio.uio_iov[0].iov_len = cop->len; cse->uio.uio_iov[0].iov_base = malloc(cop->len, M_XDATA, M_WAITOK); - for (i = 0; i < cse->uio.uio_iovcnt; i++) - cse->uio.uio_resid += cse->uio.uio_iov[0].iov_len; + cse->uio.uio_resid = cse->uio.uio_iov[0].iov_len; /* number of requests, not logical and */ crp = crypto_getreq((cse->txform != NULL) + (cse->thash != NULL)); |