diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-07-20 19:47:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-07-20 19:47:54 +0000 |
commit | 64f028828d17fb0c811da5fd9280ca0c67284ba1 (patch) | |
tree | 6b43da4b026245d245f971c0d017fd5a9a0793e3 | |
parent | 14d40d110bb80779e96106c6b2555f5c753dc812 (diff) |
look up correct dev_t. This matters for the case where a device is
underlying softraid.
ok mlarkin
-rw-r--r-- | sys/arch/amd64/amd64/hibernate_machdep.c | 5 | ||||
-rw-r--r-- | sys/arch/i386/i386/hibernate_machdep.c | 5 | ||||
-rw-r--r-- | sys/arch/loongson/loongson/hibernate_machdep.c | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/sys/arch/amd64/amd64/hibernate_machdep.c b/sys/arch/amd64/amd64/hibernate_machdep.c index 5b7e148780f..be69a7ebb96 100644 --- a/sys/arch/amd64/amd64/hibernate_machdep.c +++ b/sys/arch/amd64/amd64/hibernate_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hibernate_machdep.c,v 1.27 2014/07/20 18:05:21 mlarkin Exp $ */ +/* $OpenBSD: hibernate_machdep.c,v 1.28 2014/07/20 19:47:53 deraadt Exp $ */ /* * Copyright (c) 2012 Mike Larkin <mlarkin@openbsd.org> @@ -92,10 +92,9 @@ get_hibernate_io_function(dev_t dev) vaddr_t addr, size_t size, int op, void *page); extern int sr_hibernate_io(dev_t dev, daddr_t blkno, vaddr_t addr, size_t size, int op, void *page); - struct device *dv; + struct device *dv = disk_lookup(&sd_cd, DISKUNIT(dev)); #if NAHCI > 0 - dv = disk_lookup(&sd_cd, DISKUNIT(swdevt[0].sw_dev)); if (dv && dv->dv_parent && dv->dv_parent->dv_parent && strcmp(dv->dv_parent->dv_parent->dv_cfdata->cf_driver->cd_name, "ahci") == 0) diff --git a/sys/arch/i386/i386/hibernate_machdep.c b/sys/arch/i386/i386/hibernate_machdep.c index 6b3bea40635..b9817d5e99d 100644 --- a/sys/arch/i386/i386/hibernate_machdep.c +++ b/sys/arch/i386/i386/hibernate_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hibernate_machdep.c,v 1.37 2014/07/20 18:05:21 mlarkin Exp $ */ +/* $OpenBSD: hibernate_machdep.c,v 1.38 2014/07/20 19:47:53 deraadt Exp $ */ /* * Copyright (c) 2011 Mike Larkin <mlarkin@openbsd.org> @@ -90,10 +90,9 @@ get_hibernate_io_function(dev_t dev) vaddr_t addr, size_t size, int op, void *page); extern int sr_hibernate_io(dev_t dev, daddr_t blkno, vaddr_t addr, size_t size, int op, void *page); - struct device *dv; + struct device *dv = disk_lookup(&sd_cd, DISKUNIT(dev)); #if NAHCI > 0 - dv = disk_lookup(&sd_cd, DISKUNIT(swdevt[0].sw_dev)); if (dv && dv->dv_parent && dv->dv_parent->dv_parent && strcmp(dv->dv_parent->dv_parent->dv_cfdata->cf_driver->cd_name, "ahci") == 0) diff --git a/sys/arch/loongson/loongson/hibernate_machdep.c b/sys/arch/loongson/loongson/hibernate_machdep.c index d95aee8ce7b..c7c9fc77002 100644 --- a/sys/arch/loongson/loongson/hibernate_machdep.c +++ b/sys/arch/loongson/loongson/hibernate_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hibernate_machdep.c,v 1.6 2014/07/20 18:05:21 mlarkin Exp $ */ +/* $OpenBSD: hibernate_machdep.c,v 1.7 2014/07/20 19:47:53 deraadt Exp $ */ /* * Copyright (c) 2013 Paul Irofti. @@ -77,10 +77,9 @@ get_hibernate_io_function(dev_t dev) vaddr_t addr, size_t size, int op, void *page); extern int sr_hibernate_io(dev_t dev, daddr_t blkno, vaddr_t addr, size_t size, int op, void *page); - struct device *dv; + struct device *dv = disk_lookup(&sd_cd, DISKUNIT(dev)); #if NAHCI > 0 - dv = disk_lookup(&sd_cd, DISKUNIT(swdevt[0].sw_dev)); if (dv && dv->dv_parent && dv->dv_parent->dv_parent && strcmp(dv->dv_parent->dv_parent->dv_cfdata->cf_driver->cd_name, "ahci") == 0) |