summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2011-11-29 04:59:23 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2011-11-29 04:59:23 +0000
commit82db9527c17cea5b145faeeb3130481f994a84ff (patch)
tree518c99b9a7e7d354678f73377652f4607d658349 /sys
parent2f9db52f73685308c096da3cc2558be8c8f6f2bc (diff)
Only free the piglet on hibernate fail if we are suspending.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/subr_hibernate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index cb4d540d290..1ae84893545 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.30 2011/11/23 07:11:31 deraadt Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.31 2011/11/29 04:59:22 mlarkin Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -685,7 +685,9 @@ get_hibernate_info(union hibernate_info *hiber_info, int suspend)
return (0);
fail:
- uvm_pmr_free_piglet(hiber_info->piglet_va, HIBERNATE_CHUNK_SIZE*3);
+ if (suspend)
+ uvm_pmr_free_piglet(hiber_info->piglet_va, HIBERNATE_CHUNK_SIZE*3);
+
return (1);
}