of: unittest: kmemleak on changeset destroy
authorFrank Rowand <frank.rowand@sony.com>
Thu, 16 Apr 2020 21:42:46 +0000 (16:42 -0500)
committerRob Herring <robh@kernel.org>
Fri, 17 Apr 2020 13:31:34 +0000 (08:31 -0500)
commitb3fb36ed694b05738d45218ea72cf7feb10ce2b1
tree094aafa40e72b92a4524f7cf98dc08abca883468
parent21a431e627046ff44a2786a9b8e8d6f12aa329f9
of: unittest: kmemleak on changeset destroy

kmemleak reports several memory leaks from devicetree unittest.
This is the fix for problem 1 of 5.

of_unittest_changeset() reaches deeply into the dynamic devicetree
functions.  Several nodes were left with an elevated reference
count and thus were not properly cleaned up.  Fix the reference
counts so that the memory will be freed.

Fixes: 201c910bd689 ("of: Transactional DT support.")
Reported-by: Erhard F. <erhard_f@mailbox.org>
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c