From: Denys Vlasenko Date: Wed, 26 Sep 2012 01:34:50 +0000 (+1000) Subject: coredump: prevent double-free on an error path in core dumper X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~36^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f34f9d186df35e5c39163444c43b4fc6255e39c5;p=pandora-kernel.git coredump: prevent double-free on an error path in core dumper In !CORE_DUMP_USE_REGSET case, if elf_note_info_init fails to allocate memory for info->fields, it frees already allocated stuff and returns error to its caller, fill_note_info. Which in turn returns error to its caller, elf_core_dump. Which jumps to cleanup label and calls free_note_info, which will happily try to free all info->fields again. BOOM. This is the fix. Signed-off-by: Oleg Nesterov Signed-off-by: Denys Vlasenko Cc: Venu Byravarasu Cc: Signed-off-by: Andrew Morton --- Reading git-diff-tree failed