Re: [PATCH] fs: prevent double-free on an error path in core dumper

2012-09-12 Thread Denys Vlasenko
On Tue, Sep 11, 2012 at 5:59 PM, Oleg Nesterov wrote: > What do you think about the patch below? Looks good. You know that I like to *remove* code :) -- vda -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majo

Re: [PATCH] fs: prevent double-free on an error path in core dumper

2012-09-11 Thread Cong Wang
On Tue, 2012-09-11 at 17:59 +0200, Oleg Nesterov wrote: > But, again, the caller does free_note_info(), so why > elf_note_info_init() > tries to handle the kmalloc failures? Afaics, we can simplify the code > and fix the bug. > > What do you think about the patch below? Looks reasonable and neat

Re: [PATCH] fs: prevent double-free on an error path in core dumper

2012-09-11 Thread Oleg Nesterov
Denys, let's not discuss this offlist... add lkml/cc's On 09/11, Denys Vlasenko wrote: > > If elf_note_info_init fails to allocate memory for info->fields, > it frees already alloceted stuff and returns error to its caller, > fill_note_info. Which in turn returns error to its caller, > elf_core_du