summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pccard.c
diff options
context:
space:
mode:
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