From: Mike Frysinger Date: Fri, 4 Jun 2010 21:14:55 +0000 (-0700) Subject: flat: fix unmap len in load error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1da083c9b23dafd6bcb08dcfec443e66e90efff0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git flat: fix unmap len in load error path The data chunk is mmaped with 'len' which remains unchanged, so use that when unmapping in the error path rather than trying to recalculate (and incorrectly so) the value used originally. Signed-off-by: Mike Frysinger Acked-by: David McCullough Acked-by: Greg Ungerer Cc: Paul Mundt Cc: Michal Simek Cc: Hirokazu Takata Cc: Geert Uytterhoeven Acked-by: David Howells Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index b8656225b34b..b6ab27ccf214 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -596,7 +596,7 @@ static int load_flat_file(struct linux_binprm * bprm, if (IS_ERR_VALUE(result)) { printk("Unable to read data+bss, errno %d\n", (int)-result); do_munmap(current->mm, textpos, text_len); - do_munmap(current->mm, realdatastart, data_len + extra); + do_munmap(current->mm, realdatastart, len); ret = result; goto err; }