From 82db9527c17cea5b145faeeb3130481f994a84ff Mon Sep 17 00:00:00 2001 From: Mike Larkin Date: Tue, 29 Nov 2011 04:59:23 +0000 Subject: Only free the piglet on hibernate fail if we are suspending. --- sys/kern/subr_hibernate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/kern') 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 @@ -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); } -- cgit v1.2.3