diff options
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index bc7d1be0960..9da98dd4727 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1236,15 +1236,14 @@ SYSCALL_DEFINE2(setdomainname, char __user *, name, int, len) | |||
1236 | 1236 | ||
1237 | SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim) | 1237 | SYSCALL_DEFINE2(getrlimit, unsigned int, resource, struct rlimit __user *, rlim) |
1238 | { | 1238 | { |
1239 | if (resource >= RLIM_NLIMITS) | 1239 | struct rlimit value; |
1240 | return -EINVAL; | 1240 | int ret; |
1241 | else { | 1241 | |
1242 | struct rlimit value; | 1242 | ret = do_prlimit(current, resource, NULL, &value); |
1243 | task_lock(current->group_leader); | 1243 | if (!ret) |
1244 | value = current->signal->rlim[resource]; | 1244 | ret = copy_to_user(rlim, &value, sizeof(*rlim)) ? -EFAULT : 0; |
1245 | task_unlock(current->group_leader); | 1245 | |
1246 | return copy_to_user(rlim, &value, sizeof(*rlim)) ? -EFAULT : 0; | 1246 | return ret; |
1247 | } | ||
1248 | } | 1247 | } |
1249 | 1248 | ||
1250 | #ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT | 1249 | #ifdef __ARCH_WANT_SYS_OLD_GETRLIMIT |