diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-10-28 21:26:12 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2012-10-28 21:26:12 +0000 |
commit | aca6b98ae75d88799690761ae3146eb6f5f229c1 (patch) | |
tree | 6623c1cea8cba6408a88422b44dbb0adf17f8708 /sys/crypto | |
parent | bdef5b4fd85163097378c66e8e784fa1af14531e (diff) |
We need to allocate memory for crp_buf in the DMA accessible
region since it's passed to the hardware directly.
Tested by Yoshihisa Matsushita <y at m8a ! org>, thanks!
ok kettenis miod
Diffstat (limited to 'sys/crypto')
-rw-r--r-- | sys/crypto/cryptodev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/crypto/cryptodev.c b/sys/crypto/cryptodev.c index 2c4434bee15..721a8f133c3 100644 --- a/sys/crypto/cryptodev.c +++ b/sys/crypto/cryptodev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptodev.c,v 1.79 2012/04/22 05:43:14 guenther Exp $ */ +/* $OpenBSD: cryptodev.c,v 1.80 2012/10/28 21:26:11 mikeb Exp $ */ /* * Copyright (c) 2001 Theo de Raadt @@ -327,7 +327,7 @@ cryptodev_op(struct csession *cse, struct crypt_op *cop, struct proc *p) cse->uio.uio_iov = cse->iovec; 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); /* XXX dma accessible */ + cse->uio.uio_iov[0].iov_base = dma_alloc(cop->len, M_WAITOK); cse->uio.uio_resid = cse->uio.uio_iov[0].iov_len; /* number of requests, not logical and */ @@ -464,7 +464,7 @@ bail: if (crp) crypto_freereq(crp); if (cse->uio.uio_iov[0].iov_base) - free(cse->uio.uio_iov[0].iov_base, M_XDATA); + dma_free(cse->uio.uio_iov[0].iov_base, cop->len); return (error); } |