mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PATCH] fix 32bit overflow in timespec_to_sample()
fix 32bit overflow in timespec_to_sample() Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
46596338a1
commit
ee500f2749
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ timespec_to_sample(clockid_t which_clock, const struct timespec *tp)
|
||||||
union cpu_time_count ret;
|
union cpu_time_count ret;
|
||||||
ret.sched = 0; /* high half always zero when .cpu used */
|
ret.sched = 0; /* high half always zero when .cpu used */
|
||||||
if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
|
if (CPUCLOCK_WHICH(which_clock) == CPUCLOCK_SCHED) {
|
||||||
ret.sched = tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec;
|
ret.sched = (unsigned long long)tp->tv_sec * NSEC_PER_SEC + tp->tv_nsec;
|
||||||
} else {
|
} else {
|
||||||
ret.cpu = timespec_to_cputime(tp);
|
ret.cpu = timespec_to_cputime(tp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue