flat: fix unmap len in load error path
authorMike Frysinger <[email protected]>
Fri, 4 Jun 2010 21:14:55 +0000 (14:14 -0700)
committerLinus Torvalds <[email protected]>
Fri, 4 Jun 2010 22:21:45 +0000 (15:21 -0700)
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 <[email protected]>
Acked-by: David McCullough <[email protected]>
Acked-by: Greg Ungerer <[email protected]>
Cc: Paul Mundt <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Hirokazu Takata <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Acked-by: David Howells <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/binfmt_flat.c

index b8656225b34b91fcc40dece1983fc4df5d36a922..b6ab27ccf214fc8c406a9ef70e91d7930af0eaec 100644 (file)
@@ -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;
                }