mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
of: unittest: kmemleak in of_unittest_overlay_high_level()
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: 39a751a4cb ("of: change overlay apply input data from unflattened to FDT")
Reported-by: Erhard F. <[email protected]>
Signed-off-by: Frank Rowand <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
a1371954ee
commit
93ef21bb1a
1 changed files with 4 additions and 1 deletions
|
|
@ -2481,8 +2481,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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue