summaryrefslogtreecommitdiff
path: root/kernel/time/posix-cpu-timers.c
diff options
context:
space:
mode:
authorChris Fries <cfries@google.com>2017-03-07 15:37:47 -0600
committerMichael Bestas <mkbestas@lineageos.org>2019-12-23 23:43:38 +0200
commit3a1d14f58f520b8c02e4475c714af3fa72c75c3e (patch)
tree7838943ac07de902ede74ac57279e49b542ff84d /kernel/time/posix-cpu-timers.c
parent68ad13d015704093618bf78dfa74778b5c4c79d4 (diff)
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>
Diffstat (limited to 'kernel/time/posix-cpu-timers.c')
-rw-r--r--kernel/time/posix-cpu-timers.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index d176c127f744..0a4f0c09bcbf 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -1253,7 +1253,8 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx,
unsigned long long now = 0;
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) {
/*