Commit f64ef295 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Matthew Wilcox

[PA-RISC] Fix parisc_newuname()

The utsname virtualisation broke parisc_newuname compilation.
Rewrite the implementation to call sys_newuname() like sparc64 does.
Signed-off-by: default avatarMatthew Wilcox <willy@parisc-linux.org>
parent ccd6c355
...@@ -266,30 +266,17 @@ long parisc_personality(unsigned long personality) ...@@ -266,30 +266,17 @@ long parisc_personality(unsigned long personality)
return err; return err;
} }
static inline int override_machine(char __user *mach) { long parisc_newuname(struct new_utsname __user *name)
#ifdef CONFIG_COMPAT
if (personality(current->personality) == PER_LINUX32) {
if (__put_user(0, mach + 6) ||
__put_user(0, mach + 7))
return -EFAULT;
}
return 0;
#else /*!CONFIG_COMPAT*/
return 0;
#endif /*CONFIG_COMPAT*/
}
long parisc_newuname(struct new_utsname __user *utsname)
{ {
int err = 0; int err = sys_newuname(name);
down_read(&uts_sem); #ifdef CONFIG_COMPAT
if (copy_to_user(utsname, &system_utsname, sizeof(*utsname))) if (!err && personality(current->personality) == PER_LINUX32) {
if (__put_user(0, name->machine + 6) ||
__put_user(0, name->machine + 7))
err = -EFAULT; err = -EFAULT;
up_read(&uts_sem); }
#endif
err = override_machine(utsname->machine);
return (long)err; return err;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment