FAILED: patch "[PATCH] of: unittest: kmemleak in of_unittest_platform_populate()" failed to apply to 4.4-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 216830d2413cc61be3f76bc02ffd905e47d2439e Mon Sep 17 00:00:00 2001
From: Frank Rowand <[email protected]>
Date: Thu, 16 Apr 2020 16:42:47 -0500
Subject: [PATCH] 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.
drivers/of/unittest.c +5 -2
@@ -1247,10 +1247,13 @@ static void __init of_unittest_platform_populate(void)of_platform_populate (np, match,NULL , &test_bus->dev);for_each_child_of_node (np, child) { -for_each_child_of_node (child, grandchild) -unittest (of_find_device_by_node (grandchild), +for_each_child_of_node (child, grandchild) { + pdev =of_find_device_by_node (grandchild); +unittest (pdev,"Could not create device for node '%pOFn'\n" , grandchild); +of_dev_put (pdev); + } }of_platform_depopulate (&test_bus->dev);