linux/drivers/of
Suraj Jitindar Singh 201b3fe586 drivers/of: Add check for null property in of_remove_property()
The validity of the property input argument to of_remove_property() is
never checked within the function and thus it is possible to pass a null
value. It happens that this will be picked up in __of_remove_property()
as no matching property of the device node will be found and thus an
error will be returned, however once again there is no explicit check
for a null value. By the time this is detected 2 locks have already been
acquired which is completely unnecessary if the property to remove is
null.

Add an explicit check in the function of_remove_property() for a null
property value and return -ENODEV in this case, this is consistent with
what the previous return value would have been when the null value was
not detected and passed to __of_remove_property().

By moving an explicit check for the property paramenter into the
of_remove_property() function, this will remove the need to perform this
check in calling code before invocation of the of_remove_property()
function.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-05-11 21:54:03 +10:00
..
unittest-data
address.c DeviceTree updates for 4.5: 2016-01-14 11:13:28 -08:00
base.c drivers/of: Add check for null property in of_remove_property() 2016-05-11 21:54:03 +10:00
device.c
dynamic.c drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
fdt_address.c of: earlycon: Move address translation to of_setup_earlycon() 2016-02-06 22:07:37 -08:00
fdt.c arm64 updates for 4.6: 2016-03-17 20:03:47 -07:00
irq.c of/irq: Fix msi-map calculation for nonzero rid-base 2016-02-11 16:51:41 -06:00
Kconfig
Makefile
of_mdio.c of_mdio: use PTR_ERR_OR_ZERO() 2016-03-14 15:31:58 -04:00
of_mtd.c
of_net.c
of_pci_irq.c
of_pci.c PCI: Remove includes of empty asm-generic/pci-bridge.h 2016-02-05 16:28:36 -06:00
of_private.h drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
of_reserved_mem.c of: alloc anywhere from memblock if range not specified 2016-03-03 16:50:30 -06:00
overlay.c drivers/of: Export OF changeset functions 2016-01-13 16:10:37 -06:00
pdt.c
platform.c of/platform: export of_default_bus_match_table 2016-01-05 09:20:44 -06:00
resolver.c of: resolver: Add missing of_node_get and of_node_put 2016-02-13 13:35:32 -06:00
unittest.c of/unittest: fix infinite loop in of_unittest_destroy_tracked_overlays() 2016-03-03 16:51:31 -06:00