]> git.baikalelectronics.ru Git - kernel.git/commit
of: unittest: fix memory leak in unittest_data_add
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Fri, 4 Oct 2019 18:58:43 +0000 (13:58 -0500)
committerRob Herring <robh@kernel.org>
Wed, 23 Oct 2019 19:42:44 +0000 (14:42 -0500)
commita9114ef3f7ca8f512f94c7bed1c027005bb3d429
treeaa4c4d87587b0284841b945334bb17a7b22bb113
parentdf8e0390ac3dc5746761c5fa7c8307b2f22528dc
of: unittest: fix memory leak in unittest_data_add

In unittest_data_add, a copy buffer is created via kmemdup. This buffer
is leaked if of_fdt_unflatten_tree fails. The release for the
unittest_data buffer is added.

Fixes: c63f640cd29f ("Enabling OF selftest to run without machine's devicetree")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Reviewed-by: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c