kernel-ark/drivers/of
Grant Likely e66c98c7a0 of: Fix NULL dereference in selftest removal code
The selftest code removes its testcase data from the live tree when
exiting, but if the testcases data tree contains an empty child of the
root, then it causes an oops due to a NULL dereference. The reason is
that the code tries to directly dereference the child pointer without
checking first if a child is actually there.

The solution is to pass the parent node into detach_node_and_children()
instead of trying to pass the child. This required removing the code
that attempts to remove all of the sibling nodes in
detach_node_and_children(), which was never sensible in the first place.

At the same time add a check to make sure the bounds of the nodes list
are not exceeded by the testdata tree. If they are then abort.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
2014-10-01 17:01:43 +01:00
..
testcase-data Merge branch 'devicetree/next-overlay' into devicetree/next 2014-08-11 14:06:23 +01:00
address.c of: Provide a function to request and map memory 2014-07-23 12:02:30 +02:00
base.c of: make sure of_alias is initialized before accessing it 2014-09-08 15:57:26 +01:00
device.c of: rename of_aliases_mutex to just of_mutex 2014-07-07 13:42:52 +01:00
dynamic.c of: Disabling OF functions that use sysfs if CONFIG_SYSFS disabled 2014-09-08 15:57:25 +01:00
fdt_address.c of/fdt: add FDT address translation support 2014-05-20 15:19:25 -05:00
fdt.c of/fdt: fix memory range check 2014-09-25 11:55:50 +01:00
irq.c of/irq: Fix lookup to use 'interrupts-extended' property first 2014-08-16 09:03:58 +01:00
Kconfig of: Fixing OF Selftest build error 2014-08-03 12:21:28 -06:00
Makefile Merge branch 'devicetree/next-overlay' into devicetree/next 2014-08-11 14:06:23 +01:00
of_mdio.c net: fix circular dependency in of_mdio code 2014-07-02 00:24:14 -07:00
of_mtd.c of_mtd: Add helpers to get ECC strength and ECC step size 2014-03-10 22:42:28 -07:00
of_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
of_pci_irq.c of_pci_irq: kill useless variable in of_irq_parse_pci() 2014-05-27 12:13:34 +01:00
of_pci.c of: implement pci_address_to_pio as weak function 2013-10-09 20:04:06 -05:00
of_private.h of: Transactional DT support. 2014-07-23 17:29:15 -06:00
of_reserved_mem.c drivers: of: add automated assignment of reserved regions to client devices 2014-08-01 12:22:21 -06:00
pdt.c of: device_node kobject lifecycle fixes 2014-03-19 14:58:40 +00:00
platform.c of/platform: Fix of_platform_device_destroy iteration of devices 2014-07-07 13:33:46 +01:00
selftest.c of: Fix NULL dereference in selftest removal code 2014-10-01 17:01:43 +01:00