of: do not use "%pOF" printk format on node with refcount of zero
authorFrank Rowand <frowand.list@gmail.com>
Mon, 13 Feb 2023 18:57:00 +0000 (12:57 -0600)
committerRob Herring <robh@kernel.org>
Mon, 20 Feb 2023 21:37:19 +0000 (15:37 -0600)
commit23522dd7033ad8dcd818f75469907a8fdac8e8a4
treea494397a5ed65f07daceff2ec931022d19199e3a
parent74df14cd301a1433947077e79ce2c610654a32e7
of: do not use "%pOF" printk format on node with refcount of zero

of_node_release() can not use the "%pOF" printk format to report
the node name of a node when the node reference count is zero.
This is because the formatter device_node_string() calls
fwnode_full_name_string() which indirectly calls of_node_get().
Calling of_node_get() on the node with a zero reference count
results in a WARNING and stack trace.

When the reference count has been decremented to zero, this function
is in the subsequent call path which frees memory related to the node.

This commit resolves the unittest EXPECT errors that were created in
the previous commmit.

Signed-off-by: Frank Rowand <frowand.list@gmail.com>
Link: https://lore.kernel.org/r/20230213185702.395776-6-frowand.list@gmail.com
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/dynamic.c