summaryrefslogtreecommitdiffstats
path: root/sys/dev/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/md/md.c')
-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 a03b078..87e5ac9 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;
OpenPOWER on IntegriCloud