* [PATCH AUTOSEL 4.4 8/8] of: unittest: kmemleak on changeset destroy
[not found] <20200424122503.11046-1-sashal@kernel.org>
@ 2020-04-24 12:25 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2020-04-24 12:25 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Frank Rowand, Erhard F ., Rob Herring, Sasha Levin, devicetree
From: Frank Rowand <frank.rowand@sony.com>
[ Upstream commit b3fb36ed694b05738d45218ea72cf7feb10ce2b1 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/of/unittest.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index af9e4785b7a6e..1ee2474fa8fbb 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -544,6 +544,10 @@ static void __init of_unittest_changeset(void)
mutex_unlock(&of_mutex);
of_changeset_destroy(&chgset);
+
+ of_node_put(n1);
+ of_node_put(n2);
+ of_node_put(n21);
#endif
}
--
2.20.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-04-24 12:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200424122503.11046-1-sashal@kernel.org>
2020-04-24 12:25 ` [PATCH AUTOSEL 4.4 8/8] of: unittest: kmemleak on changeset destroy Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).