qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, peter.maydell@linaro.org
Subject: Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
Date: Fri, 8 May 2020 08:45:20 -0500	[thread overview]
Message-ID: <85ab3d39-0916-3637-6568-70166436e7f8@redhat.com> (raw)
In-Reply-To: <20200508104933.19051-1-armbru@redhat.com>

On 5/8/20 5:49 AM, Markus Armbruster wrote:
> Fixes: abc9bf69a66a11499a801ff545b8fe7adbb3a04c
> Fixes: Coverity CID 1428754
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   cpus.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/cpus.c b/cpus.c
> index 5670c96bcf..b9275c672d 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -813,7 +813,7 @@ void configure_icount(QemuOpts *opts, Error **errp)
>           return;
>       }
>   
> -    if (strcmp(option, "auto") != 0) {
> +    if (option && !strcmp(option, "auto")) {

Another alternative would be using g_strcmp0, but this form is fine.

>           if (qemu_strtol(option, NULL, 0, &time_shift) < 0
>               || time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
>               error_setg(errp, "icount: Invalid shift value");
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



  reply	other threads:[~2020-05-08 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 10:49 [PATCH] cpus: Fix botched configure_icount() error API violation fix Markus Armbruster
2020-05-08 13:45 ` Eric Blake [this message]
2020-05-08 16:12   ` Philippe Mathieu-Daudé
2020-05-08 17:43 ` Markus Armbruster
2020-05-21 14:43 ` Paolo Bonzini
2020-05-25  5:44   ` Markus Armbruster
2020-05-25 10:21     ` Paolo Bonzini

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=85ab3d39-0916-3637-6568-70166436e7f8@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).