mips/cps: Fix mips_cps_realize() error API violations
commit81f66cfd24ccd2645b19366d768a72f20ea3838b
authorMarkus Armbruster <armbru@redhat.com>
Tue, 30 Jun 2020 09:03:44 +0000 (30 11:03 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 2 Jul 2020 04:25:29 +0000 (2 06:25 +0200)
treec81a9c5321ed12787d4265413f03ac540270a794
parent3e9a88c3721cd0171ab4e51f0b3617befd124e2a
mips/cps: Fix mips_cps_realize() error API violations

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.

mips_cps_realize() is wrong that way: it passes &err to multiple
object_property_set_FOO() without checking for failure, and then to
sysbus_realize().  Harmless, because the object_property_set_FOO()
can't actually fail here.

Fix by passing &error_abort instead.

Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200630090351.1247703-20-armbru@redhat.com>
hw/mips/cps.c