Patch "of: unittest: kmemleak on changeset destroy" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    of: unittest: kmemleak on changeset destroy

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     of-unittest-kmemleak-on-changeset-destroy.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3cc24c9f756b3c6cf053671d0a108bc8736abe7e
Author: Frank Rowand <frank.rowand@xxxxxxxx>
Date:   Thu Apr 16 16:42:46 2020 -0500

    of: unittest: kmemleak on changeset destroy
    
    [ 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@xxxxxxxxxxx>
    Signed-off-by: Frank Rowand <frank.rowand@xxxxxxxx>
    Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 55c98f119df22..e7e6dd07f2150 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -605,6 +605,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
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux