Commit fd69d544 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/syscalls: Use sys_old_select() in ppc_select()

Instead of opencodying the copy of parameters, use
the generic sys_old_select().
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/4de983ad254739da1fe6e9f273baf387b7043ae0.1615398498.git.christophe.leroy@csgroup.eu
parent 4b8cda58
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
#define __ARCH_WANT_OLD_STAT #define __ARCH_WANT_OLD_STAT
#define __ARCH_WANT_SYS_OLD_SELECT
#endif #endif
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
#define __ARCH_WANT_SYS_TIME #define __ARCH_WANT_SYS_TIME
......
...@@ -82,16 +82,8 @@ int ...@@ -82,16 +82,8 @@ int
ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct __kernel_old_timeval __user *tvp) ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, struct __kernel_old_timeval __user *tvp)
{ {
if ( (unsigned long)n >= 4096 ) if ( (unsigned long)n >= 4096 )
{ return sys_old_select((void __user *)n);
unsigned long __user *buffer = (unsigned long __user *)n;
if (!access_ok(buffer, 5*sizeof(unsigned long))
|| __get_user(n, buffer)
|| __get_user(inp, ((fd_set __user * __user *)(buffer+1)))
|| __get_user(outp, ((fd_set __user * __user *)(buffer+2)))
|| __get_user(exp, ((fd_set __user * __user *)(buffer+3)))
|| __get_user(tvp, ((struct __kernel_old_timeval __user * __user *)(buffer+4))))
return -EFAULT;
}
return sys_select(n, inp, outp, exp, tvp); return sys_select(n, inp, outp, exp, tvp);
} }
#endif #endif
......
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