qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix


From: Eric Blake
Subject: Re: [PATCH] cpus: Fix botched configure_icount() error API violation fix
Date: Fri, 8 May 2020 08:45:20 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

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

Reviewed-by: Eric Blake <address@hidden>


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 via email to

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