summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-11-02 17:31:01 +0000
committerimp <imp@FreeBSD.org>2001-11-02 17:31:01 +0000
commit6f22452d47ab1ef0b6917a478b886a14bd9d2a95 (patch)
treedcdfe1496449a3873b898673e91dc22eb1c32eca /sys/pccard/pccard.c
parentbf4b2ea40eae132c607ed882ce91cde889b727a3 (diff)
downloadFreeBSD-src-6f22452d47ab1ef0b6917a478b886a14bd9d2a95.zip
FreeBSD-src-6f22452d47ab1ef0b6917a478b886a14bd9d2a95.tar.gz
Print a warning when device_add_child returns NULL. This used to be
impossible at this point, but now it apparently is. Grump. Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org>
Diffstat (limited to 'sys/pccard/pccard.c')
-rw-r--r--sys/pccard/pccard.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c
index dfd12fe..b730ee2 100644
--- a/sys/pccard/pccard.c
+++ b/sys/pccard/pccard.c
@@ -242,6 +242,11 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
bcopy(desc->misc, devi->misc, sizeof(desc->misc));
resource_list_init(&devi->resources);
child = device_add_child(pccarddev, devi->name, desc->unit);
+ if (child == NULL) {
+ device_printf(pccardd,
+ "device_add_child shouldn't have failed, but did\n"");
+ return (EIO);
+ }
device_set_flags(child, desc->flags);
device_set_ivars(child, devi);
if (bootverbose) {
OpenPOWER on IntegriCloud