* [PATCH] qemu-timer: check for timerlist being initialised
@ 2024-08-28 8:34 Ben Dooks
0 siblings, 0 replies; only message in thread
From: Ben Dooks @ 2024-08-28 8:34 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Ben Dooks
If you create a new timer before the timer lists have been
initialised then you will end up with an abort due to trying
to access an illegal timer list struct. Add an assert() for
the timer list being NON-null.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
util/qemu-timer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/util/qemu-timer.c b/util/qemu-timer.c
index 213114be68..5c0c6be56b 100644
--- a/util/qemu-timer.c
+++ b/util/qemu-timer.c
@@ -365,6 +365,7 @@ void timer_init_full(QEMUTimer *ts,
timer_list_group = &main_loop_tlg;
}
ts->timer_list = timer_list_group->tl[type];
+ assert(ts->timer_list != NULL);
ts->cb = cb;
ts->opaque = opaque;
ts->scale = scale;
--
2.37.2.352.g3c44437643
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-08-28 9:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 8:34 [PATCH] qemu-timer: check for timerlist being initialised Ben Dooks
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).