From d56e7a611e63dcdcf8f405479edcc94e105bf51c Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Wed, 3 Jul 2013 10:21:37 +1000 Subject: [PATCH] coredump: '% at the end' shouldn't bypass core_uses_pid logic "goto end" should not bypass the "Backward compatibility with core_uses_pid" code, move this label up. While at it, - It is ugly to copy '|' into cn->corename and then inc the pointer for argv_split(). Change format_corename() to increment pat_ptr instead. - Remove the dead "if (*pat_ptr == 0)" in format_corename(), we already checked it is not zero. Signed-off-by: Oleg Nesterov Cc: Andi Kleen Cc: Colin Walters Cc: Denys Vlasenko Cc: Jiri Slaby Cc: Lennart Poettering Cc: Lucas De Marchi Acked-by: Neil Horman Signed-off-by: Andrew Morton --- fs/coredump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/coredump.c b/fs/coredump.c index fb4e2b7ea07b..e10f976a22db 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -167,6 +167,9 @@ static int format_corename(struct core_name *cn, struct coredump_params *cprm) return -ENOMEM; cn->corename[0] = '\0'; + if (ispipe) + ++pat_ptr; + if (ispipe) ++pat_ptr; -- 2.39.2