[MIPS] Fix O32 personality(2) call with 0xffffffff argument.

A sign extension bug did result in sys_personality being invoked with a
0xffffffffffffffffUL argument, so querying the current personality didn't
work.

Signed-off-by: Thiemo Seufer <ths@networkno.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Thiemo Seufer 2006-08-13 00:53:29 +01:00 committed by Ralf Baechle
parent 36d98e79b7
commit 53571ce470
1 changed files with 3 additions and 1 deletions

View File

@ -1055,7 +1055,9 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name)
asmlinkage int sys32_personality(unsigned long personality)
{
int ret;
if (current->personality == PER_LINUX32 && personality == PER_LINUX)
personality &= 0xffffffff;
if (personality(current->personality) == PER_LINUX32 &&
personality == PER_LINUX)
personality = PER_LINUX32;
ret = sys_personality(personality);
if (ret == PER_LINUX32)