]> git.baikalelectronics.ru Git - kernel.git/commit
of: unittest: kmemleak in of_unittest_platform_populate()
authorFrank Rowand <frank.rowand@sony.com>
Thu, 16 Apr 2020 21:42:47 +0000 (16:42 -0500)
committerRob Herring <robh@kernel.org>
Fri, 17 Apr 2020 13:31:34 +0000 (08:31 -0500)
commit9b3acf302e2161fcfb7ffe6901f3c6e8394009bf
tree9d7514a59326016292465e50cffaec93960a6a62
parent4601c1d4033cbb6aa3efc55fbc6d2e6dba8c1d2b
of: unittest: kmemleak in of_unittest_platform_populate()

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

of_unittest_platform_populate() left an elevated reference count for
grandchild nodes (which are platform devices).  Fix the platform
device reference counts so that the memory will be freed.

Fixes: d41501864f95 ("of/selftest: add testcase for nodes with same name and address")
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