Re: [PATCH v2] of: unittest: fix memory leak in attach_node_and_children

2019-11-26 Thread Rob Herring
On Tue, 26 Nov 2019 02:48:04 +0100, Erhard Furtner wrote: > In attach_node_and_children memory is allocated for full_name via > kasprintf. If the condition of the 1st if is not met the function > returns early without freeing the memory. Add a kfree() to fix that. > > This has been detected with

[PATCH v2] of: unittest: fix memory leak in attach_node_and_children

2019-11-25 Thread Erhard Furtner
In attach_node_and_children memory is allocated for full_name via kasprintf. If the condition of the 1st if is not met the function returns early without freeing the memory. Add a kfree() to fix that. This has been detected with kmemleak: Link: https://bugzilla.kernel.org/show_bug.cgi?id=205327