提交 f64ef295 编写于 作者: M Matthew Wilcox 提交者: 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: NMatthew Wilcox <willy@parisc-linux.org>
上级 ccd6c355
......@@ -266,30 +266,17 @@ long parisc_personality(unsigned long personality)
return err;
}
static inline int override_machine(char __user *mach) {
#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)
long parisc_newuname(struct new_utsname __user *name)
{
int err = 0;
int err = sys_newuname(name);
down_read(&uts_sem);
if (copy_to_user(utsname, &system_utsname, sizeof(*utsname)))
err = -EFAULT;
up_read(&uts_sem);
err = override_machine(utsname->machine);
#ifdef CONFIG_COMPAT
if (!err && personality(current->personality) == PER_LINUX32) {
if (__put_user(0, name->machine + 6) ||
__put_user(0, name->machine + 7))
err = -EFAULT;
}
#endif
return (long)err;
return err;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册