cpus: Fix configure_icount() error API violation
commitabc9bf69a66a11499a801ff545b8fe7adbb3a04c
authorMarkus Armbruster <armbru@redhat.com>
Wed, 22 Apr 2020 13:07:08 +0000 (22 15:07 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 29 Apr 2020 06:01:52 +0000 (29 08:01 +0200)
tree736e0b8fb8494c84a24ce2740bcaa086cb3ddd5b
parent77ed971b9d96a288e497509054e1e59493ffd1fc
cpus: Fix configure_icount() error API violation

The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

configure_icount() is wrong that way.  Harmless, because its @errp is
always &error_abort or &error_fatal.

Just as wrong (and just as harmless): when it fails, it can still
update global state.

Fix all that.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200422130719.28225-4-armbru@redhat.com>
cpus.c