colo-compare: Remove superfluous NULL-pointer checks for s->iothread
PATCH 1/1 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).
--- net/colo-compare.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
net/colo-compare.c +2 -6
@@ -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);
Signature · 1 line
2.20.1
Quoted 5 lines · Lukas Straub
s->iothreadis checked for NULL on object creation incolo_compare_complete, so it's guaranteed not to be NULL.
This resolves a false alert from Coverity (CID 1429969).Signed-off-by Lukas Straub <[email protected]>
Quoted 31 lines
--- net/colo-compare.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)net/colo-compare.c +2
-6@@ -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);
Quoted 6 lines · Lukas Straub <[email protected]> 于2020年7月31日周五 下午1:09写道:
s->iothreadis checked for NULL on object creation incolo_compare_complete, so it's guaranteed not to be NULL.
This resolves a false alert from Coverity (CID 1429969).Signed-off-by Lukas Straub <[email protected]>
Quoted 32 lines
--- net/colo-compare.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)net/colo-compare.c +2
-7@@ -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); --2.20.1
Quoted 11 lines
-----Original Message-----
From: Lukas Straub <[email protected]>
Sent: Friday, July 31, 2020 1:06 PM
To: qemu-devel <[email protected]>
Cc: Peter Maydell <[email protected]>; Jason Wang <[email protected]>; Zhang, Chen <[email protected]>
Subject: [PATCH] colo-compare: Remove superfluous NULL-pointer checks fors->iothread
Quoted 5 lines
s->iothreadis checked for NULL on object creation ins->colo_compare_complete,
so it's guaranteed not to be NULL.
This resolves a false alert from Coverity (CID 1429969).
Quoted 33 lines
Signed-off-by Lukas Straub <[email protected]>--- net/colo-compare.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)net/colo-compare.c index renamed from net/colo-compare.c +0
-0
cc15f23dea..2c20de1537100644net/colo-compare.c +2
-7@@ -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); --2.20.1
Jason Wang
AppliedQuoted 25 lines · Lukas Straub
s->iothreadis checked for NULL on object creation incolo_compare_complete, so it's guaranteed not to be NULL.
This resolves a false alert from Coverity (CID 1429969).Signed-off-by Lukas Straub <[email protected]>--- net/colo-compare.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)net/colo-compare.c +1
-3@@ -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);
net/colo-compare.c static void colo_compare_finalize(Object *obj) · line 1474
Quoted 10 lines
net/colo-compare.c +1
-3@@ -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