s390x/cpumodel: Fix query-cpu-model-FOO error API violations
commite47970f51dc4926feea976e05a955408527d4a3c
authorMarkus Armbruster <armbru@redhat.com>
Wed, 4 Dec 2019 09:36:21 +0000 (4 10:36 +0100)
committerCornelia Huck <cohuck@redhat.com>
Sat, 14 Dec 2019 09:25:50 +0000 (14 10:25 +0100)
tree6d04ae2de37e072280be1fc8aab5d84096ba9f49
parentd687ae1ae280569f3072c28985cc2eba658b9b3f
s390x/cpumodel: Fix query-cpu-model-FOO error API violations

cpu_model_from_info() is a helper for qmp_query_cpu_model_expansion(),
qmp_query_cpu_model_comparison(), qmp_query_cpu_model_baseline().  It
dereferences @errp when the visitor or the QOM setter fails.  That's
wrong; see the big comment in error.h.  Introduced in commit
137974cea3 's390x/cpumodel: implement QMP interface
"query-cpu-model-expansion"'.

Its three callers have the same issue.  Introduced in commit
4e82ef0502 's390x/cpumodel: implement QMP interface
"query-cpu-model-comparison"' and commit f1a47d08ef 's390x/cpumodel:
implement QMP interface "query-cpu-model-baseline"'.

No caller actually passes null.

Fix anyway: splice in a local Error *err, and error_propagate().

Cc: David Hildenbrand <david@redhat.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20191204093625.14836-15-armbru@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
target/s390x/cpu_models.c