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

[qemu-xen staging] colo-compare: Remove superfluous NULL-pointer checks for s->iothread



commit f81cddfe8abe7d7e2220e611ee69d2cdf34eb789
Author:     Lukas Straub <lukasstraub2@xxxxxx>
AuthorDate: Fri Jul 31 07:06:04 2020 +0200
Commit:     Jason Wang <jasowang@xxxxxxxxxx>
CommitDate: Tue Aug 4 14:14:48 2020 +0800

    colo-compare: Remove superfluous NULL-pointer checks for s->iothread
    
    s->iothread is checked for NULL on object creation in colo_compare_complete,
    so it's guaranteed not to be NULL.
    This resolves a false alert from Coverity (CID 1429969).
    
    Signed-off-by: Lukas Straub <lukasstraub2@xxxxxx>
    Reviewed-by: Philippe Mathieu-Daud�© <philmd@xxxxxxxxxx>
    Reviewed-by: Li Qiang <liq3ea@xxxxxxxxx>
    Reviewed-by: Zhang Chen <chen.zhang@xxxxxxxxx>
    Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
---
 net/colo-compare.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/net/colo-compare.c b/net/colo-compare.c
index cc15f23dea..2c20de1537 100644
--- a/net/colo-compare.c
+++ b/net/colo-compare.c
@@ -1442,9 +1442,7 @@ static void colo_compare_finalize(Object *obj)
         qemu_chr_fe_deinit(&s->chr_notify_dev, false);
     }
 
-    if (s->iothread) {
-        colo_compare_timer_del(s);
-    }
+    colo_compare_timer_del(s);
 
     qemu_bh_delete(s->event_bh);
 
@@ -1470,9 +1468,7 @@ static void colo_compare_finalize(Object *obj)
         g_hash_table_destroy(s->connection_track_table);
     }
 
-    if (s->iothread) {
-        object_unref(OBJECT(s->iothread));
-    }
+    object_unref(OBJECT(s->iothread));
 
     g_free(s->pri_indev);
     g_free(s->sec_indev);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#staging



 


Rackspace

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