Skip to content

Commit

Permalink
flat: fix unmap len in load error path
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
vapier authored and torvalds committed Jun 4, 2010
1 parent 2e94de8 commit 1da083c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/binfmt_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1da083c

Please sign in to comment.