aboutsummaryrefslogtreecommitdiff
path: root/hw/timer/mss-timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/timer/mss-timer.c')
-rw-r--r--hw/timer/mss-timer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/timer/mss-timer.c b/hw/timer/mss-timer.c
index 29943fd..fe0ca90 100644
--- a/hw/timer/mss-timer.c
+++ b/hw/timer/mss-timer.c
@@ -244,6 +244,18 @@ static void mss_timer_init(Object *obj)
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &t->mmio);
}
+static void mss_timer_finalize(Object *obj)
+{
+ MSSTimerState *t = MSS_TIMER(obj);
+ int i;
+
+ for (i = 0; i < NUM_TIMERS; i++) {
+ struct Msf2Timer *st = &t->timers[i];
+
+ ptimer_free(st->ptimer);
+ }
+}
+
static const VMStateDescription vmstate_timers = {
.name = "mss-timer-block",
.version_id = 1,
@@ -287,6 +299,7 @@ static const TypeInfo mss_timer_info = {
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(MSSTimerState),
.instance_init = mss_timer_init,
+ .instance_finalize = mss_timer_finalize,
.class_init = mss_timer_class_init,
};