summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-02-11 22:05:21 +0000
committerjhb <jhb@FreeBSD.org>2014-02-11 22:05:21 +0000
commitee403b8a8ce84a0bb539f208b2db9f5f86a01751 (patch)
treeb38b3048306104de703a42e247aa5c4866b8168f /sys/vm
parent22ac1edc7b00df49e25d5031c905525c9a0bc11a (diff)
downloadFreeBSD-src-ee403b8a8ce84a0bb539f208b2db9f5f86a01751.zip
FreeBSD-src-ee403b8a8ce84a0bb539f208b2db9f5f86a01751.tar.gz
Correct assertion to assert that the existing device VM object uses the
same type rather than asserting in the case where we just created a new VM object. Reviewed by: kib
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/device_pager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index 8113f03..13491ba 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -169,18 +169,20 @@ cdev_pager_allocate(void *handle, enum obj_type tp, struct cdev_pager_ops *ops,
*/
if (pindex > object->size)
object->size = pindex;
+ KASSERT(object->type == tp,
+ ("Inconsistent device pager type %p %d", object, tp));
} else {
object = object1;
object1 = NULL;
object->handle = handle;
TAILQ_INSERT_TAIL(&dev_pager_object_list, object,
pager_object_list);
- KASSERT(object->type == tp,
- ("Inconsistent device pager type %p %d", object, tp));
}
} else {
if (pindex > object->size)
object->size = pindex;
+ KASSERT(object->type == tp,
+ ("Inconsistent device pager type %p %d", object, tp));
}
mtx_unlock(&dev_pager_mtx);
if (object1 != NULL) {
OpenPOWER on IntegriCloud