diff options
author | imp <imp@FreeBSD.org> | 2001-11-02 17:31:01 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-11-02 17:31:01 +0000 |
commit | 6f22452d47ab1ef0b6917a478b886a14bd9d2a95 (patch) | |
tree | dcdfe1496449a3873b898673e91dc22eb1c32eca /sys/pccard/pccard.c | |
parent | bf4b2ea40eae132c607ed882ce91cde889b727a3 (diff) | |
download | FreeBSD-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.c | 5 |
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) { |