[PATCH v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Yunfeng Ye
Fix the @data and @fd allocations that are leaked in the error path of apply_xbc(). Fixes: 85c46b78da58 ("bootconfig: Add bootconfig magic word for indicating bootconfig explicitly") Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command") Acked-by: Masami Hiramatsu Signed-off-by: Yunfe

Re: [v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Markus Elfring
> this change can fix the warning of tools. Would you like to point any specific source code analysis tools out for this issue? (Can a corresponding attribution become relevant for a clearer change description?) Regards, Markus

Re: [v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Yunfeng Ye
On 2020/5/8 19:30, Markus Elfring wrote: >> this change can fix the warning of tools. > > Would you like to point any specific source code analysis tools out > for this issue? > (Can a corresponding attribution become relevant for a clearer > change description?) > The tools we used is not for

Re: [v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Steven Rostedt
On Fri, 8 May 2020 19:42:56 +0800 Yunfeng Ye wrote: > On 2020/5/8 19:30, Markus Elfring wrote: > >> this change can fix the warning of tools. > > > > Would you like to point any specific source code analysis tools out > > for this issue? > > (Can a corresponding attribution become relevant for

Re: [v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Markus Elfring
> Markus please stop! Your suggestions are just your preferences that are not > required for the kernel. Do our imaginations and expectations differ for a good commit message? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=79

Re: [v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Dan Carpenter
On Fri, May 08, 2020 at 09:00:53AM -0400, Steven Rostedt wrote: > On Fri, 8 May 2020 19:42:56 +0800 > Yunfeng Ye wrote: > > > On 2020/5/8 19:30, Markus Elfring wrote: > > >> this change can fix the warning of tools. > > > > > > Would you like to point any specific source code analysis tools ou

Re: [v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Steven Rostedt
On Fri, 8 May 2020 17:45:27 +0300 Dan Carpenter wrote: > > Yunfeng, your v2 was fine and has already landed in Linus's tree. Feel free > > to ignore Markus's suggestions in the future. > > There was actually a bug in v2. It exits with a non-zero instead of > zero on success so it will mess up

Re: [v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Markus Elfring
>> There was actually a bug in v2. It exits with a non-zero instead of >> zero on success so it will mess up people's scripts. > > Thanks, I just fixed it. And because of the distraction of Markus's > bikesheding, it was missed :-( I am curious how the software development attention will evolve f

Re: [PATCH v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Markus Elfring
… > +++ b/tools/bootconfig/main.c > @@ -314,31 +314,35 @@ int apply_xbc(const char *path, const char *xbc_path) … > +free_data: > free(data); … Would any software users prefer to omit the memory release for a quicker program termination? Can the commit message become clearer about the expla

Re: [PATCH v3] tools/bootconfig: fix resource leak in apply_xbc()

2020-05-08 Thread Yunfeng Ye
On 2020/5/8 19:03, Markus Elfring wrote: > … >> +++ b/tools/bootconfig/main.c >> @@ -314,31 +314,35 @@ int apply_xbc(const char *path, const char *xbc_path) > … >> +free_data: >> free(data); > … > > Would any software users prefer to omit the memory release for > a quicker program terminat