aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2007-01-19 08:49:28 +0000
committerWarner Losh <imp@FreeBSD.org>2007-01-19 08:49:28 +0000
commit7e2ff8bbff073b8f2d10ad9d4f1929e66f16395d (patch)
tree5104fd2584e9b529061f591e8346b1d6c59b7476 /sys
parent64b4073914d0f31e2148082f816f281c3522f6ee (diff)
Cope gracefully with device_get_children returning an error.
Obtained from: Hans Petter Selasky P4: http://perforce.freebsd.org/chv.cgi?CH=112957
Notes
Notes: svn path=/head/; revision=166104
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/cardbus/cardbus.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index 2e3453eaccb7..bd2b31c591ab 100644
--- a/sys/dev/cardbus/cardbus.c
+++ b/sys/dev/cardbus/cardbus.c
@@ -217,7 +217,8 @@ cardbus_detach_card(device_t cbdev)
int tmp;
int err = 0;
- device_get_children(cbdev, &devlist, &numdevs);
+ if (device_get_children(cbdev, &devlist, &numdevs) != 0)
+ return (ENOENT);
if (numdevs == 0) {
free(devlist, M_TEMP);
@@ -251,7 +252,9 @@ cardbus_driver_added(device_t cbdev, driver_t *driver)
struct cardbus_devinfo *dinfo;
DEVICE_IDENTIFY(driver, cbdev);
- device_get_children(cbdev, &devlist, &numdevs);
+ if (device_get_children(cbdev, &devlist, &numdevs) != 0)
+ return;
+
/*
* If there are no drivers attached, but there are children,
* then power the card up.