summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-01-19 08:49:28 +0000
committerimp <imp@FreeBSD.org>2007-01-19 08:49:28 +0000
commit7cf268c182d61ddd7bf90b42ac7114274e19372d (patch)
tree5104fd2584e9b529061f591e8346b1d6c59b7476 /sys/dev/cardbus
parent53becc06fe8e99aaf736fbea9df0fccd87736216 (diff)
downloadFreeBSD-src-7cf268c182d61ddd7bf90b42ac7114274e19372d.zip
FreeBSD-src-7cf268c182d61ddd7bf90b42ac7114274e19372d.tar.gz
Cope gracefully with device_get_children returning an error.
Obtained from: Hans Petter Selasky P4: http://perforce.freebsd.org/chv.cgi?CH=112957
Diffstat (limited to 'sys/dev/cardbus')
-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 2e3453e..bd2b31c 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.
OpenPOWER on IntegriCloud