diff options
| author | 2012-07-16 12:15:58 +0000 | |
|---|---|---|
| committer | 2012-07-16 12:15:58 +0000 | |
| commit | a8dcd0fccad0bb4171bb9314d894f2bb9e0281be (patch) | |
| tree | 1d638daa32a8350a7f1110eb2fd64628932c8a2c /sys/kern/subr_hibernate.c | |
| parent | As usual, turn off POOL_DEBUG for the release. Note that POOL_DEBUG is (diff) | |
| download | wireguard-openbsd-a8dcd0fccad0bb4171bb9314d894f2bb9e0281be.tar.xz wireguard-openbsd-a8dcd0fccad0bb4171bb9314d894f2bb9e0281be.zip | |
Make sure we have a swap partition before trying to read or write
hibernate info.
ok mlarkin@ stsp@
Diffstat (limited to 'sys/kern/subr_hibernate.c')
| -rw-r--r-- | sys/kern/subr_hibernate.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c index 8615214d58f..abd50deeb5a 100644 --- a/sys/kern/subr_hibernate.c +++ b/sys/kern/subr_hibernate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_hibernate.c,v 1.43 2012/07/15 16:09:14 stsp Exp $ */ +/* $OpenBSD: subr_hibernate.c,v 1.44 2012/07/16 12:15:58 jsing Exp $ */ /* * Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl> @@ -622,6 +622,11 @@ get_hibernate_info(union hibernate_info *hiber_info, int suspend) return (1); } + /* Make sure we have a swap partition. */ + if (dl.d_partitions[1].p_fstype != FS_SWAP || + dl.d_partitions[1].p_size == 0) + return (1); + hiber_info->secsize = dl.d_secsize; /* Make sure the signature can fit in one block */ |
