Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: unittest: Use of_property_present()

Use of_property_present() to test for property presence rather than
of_find_property(). This is part of a larger effort to remove callers
of of_find_property() and similar functions. of_find_property() leaks
the DT struct property and data pointers which is a problem for
dynamically allocated nodes which may be freed.

Link: https://lore.kernel.org/r/20240731191312.1710417-10-robh@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

+2 -2
+2 -2
drivers/of/unittest.c
··· 900 900 unittest(!of_find_node_by_path("/testcase-data/changeset/n2/n21"), 901 901 "'%pOF' still present after revert\n", n21); 902 902 903 - ppremove = of_find_property(parent, "prop-remove", NULL); 904 - unittest(ppremove, "failed to find removed prop after revert\n"); 903 + unittest(of_property_present(parent, "prop-remove"), 904 + "failed to find removed prop after revert\n"); 905 905 906 906 ret = of_property_read_string(parent, "prop-update", &propstr); 907 907 unittest(!ret, "failed to find updated prop after revert\n");