summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2020-04-17 00:42:49 +0300
committerRob Herring <robh@kernel.org>2020-04-17 16:31:34 +0300
commit478ff649b1c8eb2409b1a54fb75eb46f7c29f140 (patch)
treed4e50935f64e7f0c2e672174ec88c33f2cc4afff /drivers
parent145fc138f9aae4f9e1331352e301df28e16aed35 (diff)
downloadlinux-478ff649b1c8eb2409b1a54fb75eb46f7c29f140.tar.xz
of: overlay: kmemleak in dup_and_fixup_symbol_prop()
kmemleak reports several memory leaks from devicetree unittest. This is the fix for problem 4 of 5. target_path was not freed in the non-error path. Fixes: e0a58f3e08d4 ("of: overlay: remove a dependency on device node full_name") 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/overlay.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index c9219fddf44b..50bbe0edf538 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -261,6 +261,8 @@ static struct property *dup_and_fixup_symbol_prop(
of_property_set_flag(new_prop, OF_DYNAMIC);
+ kfree(target_path);
+
return new_prop;
err_free_new_prop: