Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2015 04:54:06 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285927 - head/sys/dev/proto
Message-ID:  <201507280454.t6S4s6tj005111@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507280454.t6S4s6tj005111>