aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-06-04 17:14:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-04 18:21:45 -0400
commit1da083c9b23dafd6bcb08dcfec443e66e90efff0 (patch)
tree2514790b650c125bf29715b01e16ccbb4206e820
parent2e94de8acbe524d919f1ea8807913d7b005e1578 (diff)
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 <vapier@gentoo.org> Acked-by: David McCullough <davidm@snapgear.com> Acked-by: Greg Ungerer <gerg@uclinux.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Michal Simek <monstr@monstr.eu> Cc: Hirokazu Takata <takata@linux-m32r.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/binfmt_flat.c2
1 files changed, 1 insertions, 1 deletions
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,
596 if (IS_ERR_VALUE(result)) { 596 if (IS_ERR_VALUE(result)) {
597 printk("Unable to read data+bss, errno %d\n", (int)-result); 597 printk("Unable to read data+bss, errno %d\n", (int)-result);
598 do_munmap(current->mm, textpos, text_len); 598 do_munmap(current->mm, textpos, text_len);
599 do_munmap(current->mm, realdatastart, data_len + extra); 599 do_munmap(current->mm, realdatastart, len);
600 ret = result; 600 ret = result;
601 goto err; 601 goto err;
602 } 602 }