aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 3481ababd06a..f2cd53e92147 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1600,12 +1600,10 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
1600 struct waitid_info info = {.status = 0}; 1600 struct waitid_info info = {.status = 0};
1601 long err = kernel_waitid(which, upid, &info, options, ru ? &r : NULL); 1601 long err = kernel_waitid(which, upid, &info, options, ru ? &r : NULL);
1602 int signo = 0; 1602 int signo = 0;
1603
1603 if (err > 0) { 1604 if (err > 0) {
1604 signo = SIGCHLD; 1605 signo = SIGCHLD;
1605 err = 0; 1606 err = 0;
1606 }
1607
1608 if (!err) {
1609 if (ru && copy_to_user(ru, &r, sizeof(struct rusage))) 1607 if (ru && copy_to_user(ru, &r, sizeof(struct rusage)))
1610 return -EFAULT; 1608 return -EFAULT;
1611 } 1609 }
@@ -1723,16 +1721,15 @@ COMPAT_SYSCALL_DEFINE5(waitid,
1723 if (err > 0) { 1721 if (err > 0) {
1724 signo = SIGCHLD; 1722 signo = SIGCHLD;
1725 err = 0; 1723 err = 0;
1726 } 1724 if (uru) {
1727 1725 /* kernel_waitid() overwrites everything in ru */
1728 if (!err && uru) { 1726 if (COMPAT_USE_64BIT_TIME)
1729 /* kernel_waitid() overwrites everything in ru */ 1727 err = copy_to_user(uru, &ru, sizeof(ru));
1730 if (COMPAT_USE_64BIT_TIME) 1728 else
1731 err = copy_to_user(uru, &ru, sizeof(ru)); 1729 err = put_compat_rusage(&ru, uru);
1732 else 1730 if (err)
1733 err = put_compat_rusage(&ru, uru); 1731 return -EFAULT;
1734 if (err) 1732 }
1735 return -EFAULT;
1736 } 1733 }
1737 1734
1738 if (!infop) 1735 if (!infop)