summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2006-11-22 06:03:39 +0000
committerimp <imp@FreeBSD.org>2006-11-22 06:03:39 +0000
commit80f8c2f6e9029ebb6189a5198809830d822904ca (patch)
treefad22565c51ef51859657c23134c4071b78a9544 /sys
parent44a6c9cd90e20195eea935e0b0ad29ca944406ae (diff)
downloadFreeBSD-src-80f8c2f6e9029ebb6189a5198809830d822904ca.zip
FreeBSD-src-80f8c2f6e9029ebb6189a5198809830d822904ca.tar.gz
<blush> copyout on read, not write.
Tweak a comment while I'm here.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/iicbus/iic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c
index b50d2e0..3d3f28f 100644
--- a/sys/dev/iicbus/iic.c
+++ b/sys/dev/iicbus/iic.c
@@ -306,7 +306,7 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t
error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs);
if (error)
break;
- /* Allocate kernel buffers for userland data, copyin write data */
+ /* Alloc kernel buffers for userland data, copyin write data */
for (i = 0; i < d->nmsgs; i++) {
m = &((struct iic_msg *)buf)[i];
usrbufs[i] = m->buf;
@@ -318,7 +318,7 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t
/* Copyout all read segments, free up kernel buffers */
for (i = 0; i < d->nmsgs; i++) {
m = &((struct iic_msg *)buf)[i];
- if (!(m->flags & IIC_M_RD))
+ if (m->flags & IIC_M_RD)
copyout(m->buf, usrbufs[i], m->len);
free(m->buf, M_TEMP);
}
OpenPOWER on IntegriCloud