summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/s390/kernel/sys_s390.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index 31cefe0c28c0..560bdaf8a74f 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -79,12 +79,15 @@ SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second,
SYSCALL_DEFINE1(s390_personality, unsigned int, personality)
{
- unsigned int ret;
+ unsigned int ret = current->personality;
if (personality(current->personality) == PER_LINUX32 &&
personality(personality) == PER_LINUX)
personality |= PER_LINUX32;
- ret = sys_personality(personality);
+
+ if (personality != 0xffffffff)
+ set_personality(personality);
+
if (personality(ret) == PER_LINUX32)
ret &= ~PER_LINUX32;