Re: [PATCH] of: unittest: fix memory leak in unittest_data_add

From: Markus Elfring
Date: Sat Oct 05 2019 - 10:34:23 EST


> 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.

Can a wording like the following be nicer for the change description?

The buffer â__dtb_testcases_beginâ will be duplicated to the local
variable âunittest_dataâ. Release the corresponding memory
after a call of the function âof_fdt_unflatten_treeâ failed
in the implementation of the function âunittest_data_addâ.


Regards,
Markus