diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-12 07:11:42 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-01-12 07:11:42 +0000 |
commit | 4e1c00f9837faf34034361086b5fc609649e7c86 (patch) | |
tree | a6f7a5aa70d1cc26b2a8182ad999224c8fafd0e0 /sys/kern | |
parent | e1b3237d742b2db84e597853605bf55c6fc5942f (diff) |
hibernate_suspend() should not pmap_kremove by itself; hibernate_free()
must do that. otherwise, pmap_kremove is called twice. i386 in particular
does not tolerate that, found by sebastia
ok mlarkin kettenis
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_hibernate.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index 114da7c1430..b48306c5d70 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.111 2014/12/22 22:22:35 mlarkin Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.112 2015/01/12 07:11:41 deraadt Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl> @@ -1806,19 +1806,19 @@ hibernate_suspend(void) DPRINTF("hibernate: writing chunks\n"); if (hibernate_write_chunks(&hib)) { DPRINTF("hibernate_write_chunks failed\n"); - goto fail; + return (1); } DPRINTF("hibernate: writing chunktable\n"); if (hibernate_write_chunktable(&hib)) { DPRINTF("hibernate_write_chunktable failed\n"); - goto fail; + return (1); } DPRINTF("hibernate: writing signature\n"); if (hibernate_write_signature(&hib)) { DPRINTF("hibernate_write_signature failed\n"); - goto fail; + return (1); } /* Allow the disk to settle */ @@ -1829,12 +1829,7 @@ hibernate_suspend(void) * done, and that it can clean up or shutdown as needed. */ hib.io_func(hib.dev, 0, (vaddr_t)NULL, 0, HIB_DONE, hib.io_page); - return (0); -fail: - pmap_kremove(HIBERNATE_HIBALLOC_PAGE, PAGE_SIZE); - pmap_update(pmap_kernel()); - return (1); } int |