PERFORCE change 190858 for review

John Baldwin jhb at FreeBSD.org
Fri Apr 1 16:33:17 UTC 2011


http://p4web.freebsd.org/@@190858?ac=10

Change 190858 by jhb at jhb_kavik on 2011/04/01 01:51:02

	Reject attempts to manage a region outside the rman's valid range.

Affected files ...

.. //depot/projects/pci/sys/kern/subr_rman.c#5 edit

Differences ...

==== //depot/projects/pci/sys/kern/subr_rman.c#5 (text+ko) ====

@@ -162,6 +162,8 @@
 
 	DPRINTF(("rman_manage_region: <%s> request: start %#lx, end %#lx\n",
 	    rm->rm_descr, start, end));
+	if (start < rm->rm_start || end > rm->rm_end)
+		return EINVAL;
 	r = int_alloc_resource(M_NOWAIT);
 	if (r == NULL)
 		return ENOMEM;
@@ -271,7 +273,7 @@
 			KASSERT(TAILQ_NEXT(r, r_link)->r_flags & RF_ALLOCATED,
 			    ("adjacent free regions"));
 		mtx_unlock(rm->rm_mtx);
-		return (ENOENT);
+		return (EBUSY);
 	}
 
 	/*


More information about the p4-projects mailing list