qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] Coverity fix on target-i386
@ 2016-11-25 21:30 Eduardo Habkost
  2016-11-25 21:30 ` [Qemu-devel] [PULL 1/1] target-i386: Remove unused local_err variable Eduardo Habkost
  2016-11-28 16:33 ` [Qemu-devel] [PULL 0/1] Coverity fix on target-i386 Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Eduardo Habkost @ 2016-11-25 21:30 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, Richard Henderson, qemu-devel

The following changes since commit 00227fefd2059464cd2f59aed29944874c630e2f:

  Update version for v2.8.0-rc1 release (2016-11-22 22:29:08 +0000)

are available in the git repository at:

  git://github.com/ehabkost/qemu.git tags/x86-pull-request

for you to fetch changes up to 685479bd5dc6f54f6230c9d05d7a3fb5cab867bf:

  target-i386: Remove unused local_err variable (2016-11-25 15:12:23 -0200)

----------------------------------------------------------------
Coverity fix on target-i386

----------------------------------------------------------------

Eduardo Habkost (1):
  target-i386: Remove unused local_err variable

 target-i386/cpu.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] target-i386: Remove unused local_err variable
  2016-11-25 21:30 [Qemu-devel] [PULL 0/1] Coverity fix on target-i386 Eduardo Habkost
@ 2016-11-25 21:30 ` Eduardo Habkost
  2016-11-28 16:33 ` [Qemu-devel] [PULL 0/1] Coverity fix on target-i386 Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Eduardo Habkost @ 2016-11-25 21:30 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, Richard Henderson, qemu-devel

local_err can never be set to non-NULL. Remove the variable.

Detected by Coverity:

    *** CID 1365201:  Possible Control flow issues  (DEADCODE)
    /target-i386/cpu.c: 2050 in x86_cpu_parse_featurestr()
    2044             prop->value = g_strdup(val);
    2045             prop->errp = &error_fatal;
    2046             qdev_prop_register_global(prop);
    2047         }
    2048
    2049         if (local_err) {
    >>>     CID 1365201:  Possible Control flow issues  (DEADCODE)
    >>>     Execution cannot reach this statement: "error_propagate(errp, local...".
    2050             error_propagate(errp, local_err);
    2051         }
    2052     }
    2053
    2054     static void x86_cpu_load_features(X86CPU *cpu, Error **errp);
    2055     static int x86_cpu_filter_features(X86CPU *cpu);

Reported-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1480087313-15102-1-git-send-email-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 6eec5dc..de1f30e 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2001,7 +2001,6 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features,
                                      Error **errp)
 {
     char *featurestr; /* Single 'key=value" string being parsed */
-    Error *local_err = NULL;
     static bool cpu_globals_initialized;
     bool ambiguous = false;
 
@@ -2015,7 +2014,7 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features,
     }
 
     for (featurestr = strtok(features, ",");
-         featurestr  && !local_err;
+         featurestr;
          featurestr = strtok(NULL, ",")) {
         const char *name;
         const char *val = NULL;
@@ -2086,10 +2085,6 @@ static void x86_cpu_parse_featurestr(const char *typename, char *features,
         error_report("warning: Compatibility of ambiguous CPU model "
                      "strings won't be kept on future QEMU versions");
     }
-
-    if (local_err) {
-        error_propagate(errp, local_err);
-    }
 }
 
 static void x86_cpu_load_features(X86CPU *cpu, Error **errp);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] Coverity fix on target-i386
  2016-11-25 21:30 [Qemu-devel] [PULL 0/1] Coverity fix on target-i386 Eduardo Habkost
  2016-11-25 21:30 ` [Qemu-devel] [PULL 1/1] target-i386: Remove unused local_err variable Eduardo Habkost
@ 2016-11-28 16:33 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2016-11-28 16:33 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Peter Maydell, Paolo Bonzini, qemu-devel, Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

On Fri, Nov 25, 2016 at 07:30:00PM -0200, Eduardo Habkost wrote:
> The following changes since commit 00227fefd2059464cd2f59aed29944874c630e2f:
> 
>   Update version for v2.8.0-rc1 release (2016-11-22 22:29:08 +0000)
> 
> are available in the git repository at:
> 
>   git://github.com/ehabkost/qemu.git tags/x86-pull-request
> 
> for you to fetch changes up to 685479bd5dc6f54f6230c9d05d7a3fb5cab867bf:
> 
>   target-i386: Remove unused local_err variable (2016-11-25 15:12:23 -0200)
> 
> ----------------------------------------------------------------
> Coverity fix on target-i386
> 
> ----------------------------------------------------------------
> 
> Eduardo Habkost (1):
>   target-i386: Remove unused local_err variable
> 
>  target-i386/cpu.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> -- 
> 2.7.4
> 
> 

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-28 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-25 21:30 [Qemu-devel] [PULL 0/1] Coverity fix on target-i386 Eduardo Habkost
2016-11-25 21:30 ` [Qemu-devel] [PULL 1/1] target-i386: Remove unused local_err variable Eduardo Habkost
2016-11-28 16:33 ` [Qemu-devel] [PULL 0/1] Coverity fix on target-i386 Stefan Hajnoczi

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).