aboutsummaryrefslogtreecommitdiff
path: root/sys/pccard
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2001-11-02 17:31:01 +0000
committerWarner Losh <imp@FreeBSD.org>2001-11-02 17:31:01 +0000
commitbcf8b176bb6a2cb888330aec4b04c77da6a96489 (patch)
treedcdfe1496449a3873b898673e91dc22eb1c32eca /sys/pccard
parentb2237d4d5cc32a357a26f7ac8da14b5479c74edc (diff)
downloadsrc-bcf8b176bb6a2cb888330aec4b04c77da6a96489.tar.gz
src-bcf8b176bb6a2cb888330aec4b04c77da6a96489.zip
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>
Notes
Notes: svn path=/head/; revision=85886
Diffstat (limited to 'sys/pccard')
-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 dfd12fee2b1f..b730ee2fcd3d 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) {