of: overlay: unittest: add tests for overlay notifiers
authorFrank Rowand <frank.rowand@sony.com>
Mon, 2 May 2022 18:17:41 +0000 (13:17 -0500)
committerRob Herring <robh@kernel.org>
Tue, 3 May 2022 16:53:15 +0000 (11:53 -0500)
commit992b0dc5c38a4e79dca17577960c5201275b83f1
treeae80fca086d8ba9942400578c2b240c0639bdf78
parent1ac17586c950a2c129393f8a92901a2b357acf24
of: overlay: unittest: add tests for overlay notifiers

Add tests for overlay apply and remove notifiers.  Trigger errors
for each of the notifier actions.

These tests will reveal a memory leak problem when a notifier returns
an error for action OF_OVERLAY_POST_APPLY.  The pr_err() message is:

   OF: ERROR: memory leak, expected refcount 1 instead of 3,
   of_node_get()/of_node_put() unbalanced - destroy cset entry: attach
   overlay node /testcase-data/overlay-node/test-bus/test-unittest17

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220502181742.1402826-3-frowand.list@gmail.com
drivers/of/unittest-data/Makefile
drivers/of/unittest-data/overlay_16.dts [new file with mode: 0644]
drivers/of/unittest-data/overlay_17.dts [new file with mode: 0644]
drivers/of/unittest-data/overlay_18.dts [new file with mode: 0644]
drivers/of/unittest-data/overlay_19.dts [new file with mode: 0644]
drivers/of/unittest-data/overlay_20.dts [new file with mode: 0644]
drivers/of/unittest.c