]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4601c1d4033cbb6aa3efc55fbc6d2e6dba8c1d2b
tree094aafa40e72b92a4524f7cf98dc08abca883468
parent6e7009359ea2368d2f6170246b3c82d7345bf525
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: e9dc07885451 ("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