mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
of: unittest: kmemleak on changeset destroy
commitb3fb36ed69upstream. 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:201c910bd6("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c8fddc945a
commit
3352cc2f7b
@@ -772,6 +772,10 @@ static void __init of_unittest_changeset(void)
|
||||
unittest(!of_changeset_revert(&chgset), "revert failed\n");
|
||||
|
||||
of_changeset_destroy(&chgset);
|
||||
|
||||
of_node_put(n1);
|
||||
of_node_put(n2);
|
||||
of_node_put(n21);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user