qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Qiang <liq3ea@gmail.com>
To: Lukas Straub <lukasstraub2@web.de>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Jason Wang <jasowang@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Zhang Chen <chen.zhang@intel.com>
Subject: Re: [PATCH] colo-compare: Remove superfluous NULL-pointer checks for s->iothread
Date: Fri, 31 Jul 2020 18:26:51 +0800	[thread overview]
Message-ID: <CAKXe6SLB9tZVO++OMHQfus-65qMAA3SHusc_WEf5ZvoBaoHe9Q@mail.gmail.com> (raw)
In-Reply-To: <20200731070604.0c981f41@luklap>

Lukas Straub <lukasstraub2@web.de> 于2020年7月31日周五 下午1:09写道:
>
> 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: Li Qiang <liq3ea@gmail.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);
> --
> 2.20.1


  parent reply	other threads:[~2020-07-31 10:28 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é
2020-07-31 10:26 ` Li Qiang [this message]
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=CAKXe6SLB9tZVO++OMHQfus-65qMAA3SHusc_WEf5ZvoBaoHe9Q@mail.gmail.com \
    --to=liq3ea@gmail.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).