Skip to content

Commit

Permalink
[PATCH] powerpc: Fix mmap returning 64 bit addresses
Browse files Browse the repository at this point in the history
The merge of syscalls.c & sys_ppc32.c (30286ef)
broke mmap, if the mmap returned a 64 bit address.

do_mmap2 was taking the return value from do_mmap_pgoff (an unsigned long), and
storing it in an int, before returning it to sys_mmap as an unsigned long. So
we were losing the high bits of the address.

You would have thought the compiler could catch this for us ...

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Oct 21, 2005
1 parent 90eac72 commit 05d8468
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static inline unsigned long do_mmap2(unsigned long addr, size_t len,
unsigned long fd, unsigned long off, int shift)
{
struct file * file = NULL;
int ret = -EINVAL;
unsigned long ret = -EINVAL;

if (shift) {
if (off & ((1 << shift) - 1))
Expand Down

0 comments on commit 05d8468

Please sign in to comment.