mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
of: unittest: kmemleak in of_unittest_overlay_high_level()
commit145fc138f9upstream. 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:39a751a4cb("of: change overlay apply input data from unflattened to FDT") 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
842f7bbaf4
commit
e04087b3f4
@@ -2448,8 +2448,11 @@ static __init void of_unittest_overlay_high_level(void)
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user