i386: Fix x86_cpu_load_model() error API violationpull-error-2020-05-27
commit49e2fa85ff04a9be89ed15f922c7d8dae2be9e74
authorMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2020 10:19:08 +0000 (5 12:19 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 27 May 2020 05:45:45 +0000 (27 07:45 +0200)
treecb63fd127227436de1d9fd00007479334b2fc718
parent3b914406cf3cfb4ac48388c1ea15036b333b7a79
i386: Fix x86_cpu_load_model() 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.

x86_cpu_load_model() is wrong that way.  Harmless, because its @errp
is always &error_abort.  To fix, cut out the @errp middleman.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200505101908.6207-11-armbru@redhat.com>
target/i386/cpu.c