This is a note to let you know that I've just added the patch titled of: unittest: kmemleak in of_unittest_overlay_high_level() to the 5.4-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-in-of_unittest_overlay_high_level.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 145fc138f9aae4f9e1331352e301df28e16aed35 Mon Sep 17 00:00:00 2001 From: Frank Rowand <frank.rowand@xxxxxxxx> Date: Thu, 16 Apr 2020 16:42:48 -0500 Subject: of: unittest: kmemleak in of_unittest_overlay_high_level() From: Frank Rowand <frank.rowand@xxxxxxxx> commit 145fc138f9aae4f9e1331352e301df28e16aed35 upstream. kmemleak reports several memory leaks from devicetree unittest. This is the fix for problem 3 of 5. of_unittest_overlay_high_level() failed to kfree the newly created property when the property named 'name' is skipped. Fixes: 39a751a4cb7e ("of: change overlay apply input data from unflattened to FDT") 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: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/of/unittest.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -2481,8 +2481,11 @@ static __init void of_unittest_overlay_h goto err_unlock; } if (__of_add_property(of_symbols, new_prop)) { + kfree(new_prop->name); + kfree(new_prop->value); + kfree(new_prop); /* "name" auto-generated by unflatten */ - if (!strcmp(new_prop->name, "name")) + if (!strcmp(prop->name, "name")) continue; unittest(0, "duplicate property '%s' in overlay_base node __symbols__", prop->name); Patches currently in stable-queue which might be from frank.rowand@xxxxxxxx are queue-5.4/of-overlay-kmemleak-in-dup_and_fixup_symbol_prop.patch queue-5.4/of-unittest-kmemleak-in-of_unittest_platform_populate.patch queue-5.4/of-unittest-kmemleak-on-changeset-destroy.patch queue-5.4/of-unittest-kmemleak-in-of_unittest_overlay_high_level.patch