diff options
author | marcel <marcel@FreeBSD.org> | 2015-07-28 04:54:05 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2015-07-28 04:54:05 +0000 |
commit | db2fee092eabf3a1fc094f15b96c5a5d5fafe29a (patch) | |
tree | 1520134136115919fdaa2f7579baa4f0a68823c3 | |
parent | fafebceb9b4261b02d6bdbab4301b2c00ae3ddf7 (diff) | |
download | FreeBSD-src-db2fee092eabf3a1fc094f15b96c5a5d5fafe29a.zip FreeBSD-src-db2fee092eabf3a1fc094f15b96c5a5d5fafe29a.tar.gz |
Check the sync operation.
-rw-r--r-- | sys/dev/proto/proto_busdma.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/proto/proto_busdma.c b/sys/dev/proto/proto_busdma.c index 52f1146..6f6bf7b 100644 --- a/sys/dev/proto/proto_busdma.c +++ b/sys/dev/proto/proto_busdma.c @@ -325,7 +325,12 @@ static int proto_busdma_sync(struct proto_busdma *busdma, struct proto_md *md, struct proto_ioc_busdma *ioc) { - + u_int ops; + + ops = BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE | + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE; + if (ioc->u.sync.op & ~ops) + return (EINVAL); if (!md->physaddr) return (ENXIO); bus_dmamap_sync(md->bd_tag, md->bd_map, ioc->u.sync.op); |