svn commit: r285927 - head/sys/dev/proto
Marcel Moolenaar
marcel at FreeBSD.org
Tue Jul 28 04:54:07 UTC 2015
Author: marcel
Date: Tue Jul 28 04:54:05 2015
New Revision: 285927
URL: https://svnweb.freebsd.org/changeset/base/285927
Log:
Check the sync operation.
Modified:
head/sys/dev/proto/proto_busdma.c
Modified: head/sys/dev/proto/proto_busdma.c
==============================================================================
--- head/sys/dev/proto/proto_busdma.c Tue Jul 28 02:32:40 2015 (r285926)
+++ head/sys/dev/proto/proto_busdma.c Tue Jul 28 04:54:05 2015 (r285927)
@@ -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);
More information about the svn-src-head
mailing list