aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sys.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index e423d0d9e6ff..47c30a20b554 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1572,11 +1572,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
1572 goto out; 1572 goto out;
1573 } 1573 }
1574 1574
1575 rcu_read_lock(); 1575 if (!lock_task_sighand(p, &flags))
1576 if (!lock_task_sighand(p, &flags)) {
1577 rcu_read_unlock();
1578 return; 1576 return;
1579 }
1580 1577
1581 switch (who) { 1578 switch (who) {
1582 case RUSAGE_BOTH: 1579 case RUSAGE_BOTH:
@@ -1612,9 +1609,7 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
1612 default: 1609 default:
1613 BUG(); 1610 BUG();
1614 } 1611 }
1615
1616 unlock_task_sighand(p, &flags); 1612 unlock_task_sighand(p, &flags);
1617 rcu_read_unlock();
1618 1613
1619out: 1614out:
1620 cputime_to_timeval(utime, &r->ru_utime); 1615 cputime_to_timeval(utime, &r->ru_utime);