diff options
author | imp <imp@FreeBSD.org> | 2008-08-23 16:38:20 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2008-08-23 16:38:20 +0000 |
commit | a45fc650347690738be16d0c27022bff273e2eff (patch) | |
tree | 9bbb308e3cf4f76e3e9ab86197f6546882dcaea6 /sys | |
parent | 9e48c37294405d347104e32d701e5c6165ccc0dc (diff) | |
download | FreeBSD-src-a45fc650347690738be16d0c27022bff273e2eff.zip FreeBSD-src-a45fc650347690738be16d0c27022bff273e2eff.tar.gz |
Handle errors from device_get_children.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpica/acpi.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index a291152..3a199b9 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -665,7 +665,9 @@ acpi_suspend(device_t dev) * device has an _SxD method for the next sleep state, use that power * state instead. */ - device_get_children(dev, &devlist, &numdevs); + error = device_get_children(dev, &devlist, &numdevs); + if (error) + return (error); for (i = 0; i < numdevs; i++) { /* If the device is not attached, we've powered it down elsewhere. */ child = devlist[i]; @@ -692,7 +694,7 @@ static int acpi_resume(device_t dev) { ACPI_HANDLE handle; - int i, numdevs; + int i, numdevs, error; device_t child, *devlist; GIANT_REQUIRED; @@ -701,7 +703,9 @@ acpi_resume(device_t dev) * Put all devices in D0 before resuming them. Call _S0D on each one * since some systems expect this. */ - device_get_children(dev, &devlist, &numdevs); + error = device_get_children(dev, &devlist, &numdevs); + if (error) + return (error); for (i = 0; i < numdevs; i++) { child = devlist[i]; handle = acpi_get_handle(child); @@ -801,7 +805,8 @@ acpi_driver_added(device_t dev, driver_t *driver) int i, numdevs; DEVICE_IDENTIFY(driver, dev); - device_get_children(dev, &devlist, &numdevs); + if (device_get_children(dev, &devlist, &numdevs)) + return; for (i = 0; i < numdevs; i++) { child = devlist[i]; if (device_get_state(child) == DS_NOTPRESENT) { |