aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fdt
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2012-12-30 21:10:48 +0000
committerRobert Watson <rwatson@FreeBSD.org>2012-12-30 21:10:48 +0000
commitff82fb46d4f91037b958d85a670a79d9cb4099f7 (patch)
tree3c7dfa8e4447a78edcda3fd981b4e69934cb4c6a /sys/dev/fdt
parentc857d06af7864b87b38277b023cad777833cc2a8 (diff)
downloadsrc-ff82fb46d4f91037b958d85a670a79d9cb4099f7.tar.gz
src-ff82fb46d4f91037b958d85a670a79d9cb4099f7.zip
When a partially initialised FDT-based device instance can't attach,
perhaps due to an interrupt configuration problem, do not try to free device ivars that have not yet have been allocated. MFC after: 1 week Reviewed by: gonzo Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=244871
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r--sys/dev/fdt/fdtbus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/fdt/fdtbus.c b/sys/dev/fdt/fdtbus.c
index 2ca7ab54ab8f..770c4c846c14 100644
--- a/sys/dev/fdt/fdtbus.c
+++ b/sys/dev/fdt/fdtbus.c
@@ -257,6 +257,8 @@ newbus_device_destroy(device_t dev)
struct fdtbus_devinfo *di;
di = device_get_ivars(dev);
+ if (di == NULL)
+ return;
free(di->di_name, M_OFWPROP);
free(di->di_type, M_OFWPROP);