bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH gnumach] fix timer bug


From: Damien Zammit
Subject: [PATCH gnumach] fix timer bug
Date: Fri, 26 Mar 2021 02:02:58 +1100

---
 kern/mach_clock.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kern/mach_clock.c b/kern/mach_clock.c
index e4d44f57..ed5cdfd3 100644
--- a/kern/mach_clock.c
+++ b/kern/mach_clock.c
@@ -152,7 +152,9 @@ void clock_interrupt(
            timer_bump(&thread->user_timer, usec);
        }
        else {
-           timer_bump(&thread->system_timer, usec);
+           /* Only bump timer if thread exists */
+           if (thread)
+               timer_bump(&thread->system_timer, usec);
        }
 #endif /* STAT_TIME */
 
@@ -189,6 +191,7 @@ void clock_interrupt(
        if (usermode)
 #endif
        {
+           if (thread)
                take_pc_sample_macro(thread, SAMPLED_PC_PERIODIC, usermode, pc);
        }
 #endif /* MACH_PCSAMPLE */
-- 
2.30.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]