posix_cpu_timer: check return on cpu_timer_sample_group

If error, don't trust "now" time that it should be setting

kernel/time/posix-cpu-timers.c:1269:13: warning: 'now' may be used uninitialized in this function [-Wmaybe-uninitialized]

Change-Id: I679d99c335494bae50fd926663fad37aedb1487a
Signed-off-by: Chris Fries <cfries@google.com>
This commit is contained in:
Chris Fries 2017-03-07 15:37:47 -06:00 committed by Timi
parent 815e2d8190
commit fa65c420dd

View file

@ -1253,7 +1253,8 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
unsigned long long now = 0; unsigned long long now = 0;
WARN_ON_ONCE(clock_idx == CPUCLOCK_SCHED); WARN_ON_ONCE(clock_idx == CPUCLOCK_SCHED);
cpu_timer_sample_group(clock_idx, tsk, &now); if (cpu_timer_sample_group(clock_idx, tsk, &now))
return;
if (oldval) { if (oldval) {
/* /*