X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=include%2Fasm-sparc64%2Fcompat.h;h=36511ca514165b4307033de76e7b09db646509c1;hb=8a87a996eae3d25b0670a243f4829ea4aa9eb63d;hp=c73935dc7ba11c8e800b79596d6ae27e3431fd30;hpb=db400b3c4ee89d384d9163836a55577abdae772d;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h index c73935dc7ba..36511ca5141 100644 --- a/include/asm-sparc64/compat.h +++ b/include/asm-sparc64/compat.h @@ -164,7 +164,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr) return (u32)(unsigned long)uptr; } -static __inline__ void __user *compat_alloc_user_space(long len) +static inline void __user *compat_alloc_user_space(long len) { struct pt_regs *regs = current_thread_info()->kregs; unsigned long usp = regs->u_regs[UREG_I6]; @@ -174,7 +174,10 @@ static __inline__ void __user *compat_alloc_user_space(long len) else usp &= 0xffffffffUL; - return (void __user *) (usp - len); + usp -= len; + usp &= ~0x7UL; + + return (void __user *) usp; } struct compat_ipc64_perm {