From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Lukas Straub <lukasstraub2@web.de>, qemu-devel <qemu-devel@nongnu.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Jason Wang <jasowang@redhat.com>,
Zhang Chen <chen.zhang@intel.com>
Subject: Re: [PATCH] colo-compare: Remove superfluous NULL-pointer checks for s->iothread
Date: Fri, 31 Jul 2020 10:36:08 +0200 [thread overview]
Message-ID: <a5667c82-71b4-f70b-3d68-121c5407b7b0@redhat.com> (raw)
In-Reply-To: <20200731070604.0c981f41@luklap>
On 7/31/20 7:06 AM, 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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> 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);
>
next prev parent reply other threads:[~2020-07-31 8:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-31 5:06 [PATCH] colo-compare: Remove superfluous NULL-pointer checks for s->iothread Lukas Straub
2020-07-31 8:36 ` Philippe Mathieu-Daudé [this message]
2020-07-31 10:26 ` Li Qiang
2020-07-31 10:32 ` Zhang, Chen
2020-08-04 6:03 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5667c82-71b4-f70b-3d68-121c5407b7b0@redhat.com \
--to=philmd@redhat.com \
--cc=chen.zhang@intel.com \
--cc=jasowang@redhat.com \
--cc=lukasstraub2@web.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).