aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/md
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2009-06-23 20:45:22 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2009-06-23 20:45:22 +0000
commit3364c323e6ad143e0e95e2d1c7c3c3b880515860 (patch)
treeefadbd0bda4d9f0ec36869d4d465b2cabf2dcd1b /sys/dev/md
parent224fbf9fd641d4f4b44cc3d6a44c7eb1b272968a (diff)
Notes
Diffstat (limited to 'sys/dev/md')
-rw-r--r--sys/dev/md/md.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index a03b0784a26e7..87e5ac9e6a6e0 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -1042,18 +1042,18 @@ mdcreate_swap(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
if (mdio->md_fwheads != 0)
sc->fwheads = mdio->md_fwheads;
sc->object = vm_pager_allocate(OBJT_SWAP, NULL, PAGE_SIZE * npage,
- VM_PROT_DEFAULT, 0);
+ VM_PROT_DEFAULT, 0, td->td_ucred);
if (sc->object == NULL)
return (ENOMEM);
sc->flags = mdio->md_options & MD_FORCE;
if (mdio->md_options & MD_RESERVE) {
if (swap_pager_reserve(sc->object, 0, npage) < 0) {
- vm_object_deallocate(sc->object);
- sc->object = NULL;
- return (EDOM);
+ error = EDOM;
+ goto finish;
}
}
error = mdsetcred(sc, td->td_ucred);
+ finish:
if (error != 0) {
vm_object_deallocate(sc->object);
sc->object = NULL;