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

[Xen-changelog] [qemu-xen-unstable] qemu_timer_pending/qemu_get_timer: cope with NULL timers



commit 68af5b5191593223709680b89951dfc84a32bee8
Author: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Date:   Mon Dec 5 13:43:34 2011 +0000

    qemu_timer_pending/qemu_get_timer: cope with NULL timers
    
    qemu_timer_pending and qemu_get_timer: don't crash if the timer passed
    as an argument is NULL.
    
    [ Fixes regression: 13b06e700528 broke save/restore on Xen. -iwj ]
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 vl.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/vl.c b/vl.c
index f07a659..f3b3d02 100644
--- a/vl.c
+++ b/vl.c
@@ -1201,6 +1201,10 @@ void qemu_mod_timer(QEMUTimer *ts, int64_t expire_time)
 int qemu_timer_pending(QEMUTimer *ts)
 {
     QEMUTimer *t;
+
+    if (ts == NULL)
+        return 0;
+
     for(t = active_timers[ts->clock->type]; t != NULL; t = t->next) {
         if (t == ts)
             return 1;
@@ -1272,6 +1276,9 @@ void qemu_get_timer(QEMUFile *f, QEMUTimer *ts)
 {
     uint64_t expire_time;
 
+    if (ts == NULL)
+        return;
+
     expire_time = qemu_get_be64(f);
     if (expire_time != -1) {
         qemu_mod_timer(ts, expire_time);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.