qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] colo-compare: Remove superfluous NULL-pointer checks for s->


From: Jason Wang
Subject: Re: [PATCH] colo-compare: Remove superfluous NULL-pointer checks for s->iothread
Date: Tue, 4 Aug 2020 14:03:13 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


On 2020/7/31 下午1:06, Lukas Straub wrote:
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@web.de>
---
  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);


Applied.

Thanks




reply via email to

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