s390x/cpumodel: Fix harmless misuse of visit_check_struct()
authorMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2020 10:19:01 +0000 (12:19 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Wed, 27 May 2020 05:45:25 +0000 (07:45 +0200)
Commit e47970f51d "s390x/cpumodel: Fix query-cpu-model-FOO error API
violations" neglected to change visit_check_struct()'s Error **
argument along with the others.  If visit_check_struct() failed, we'd
take the success path.  Fortunately, it can't fail here:
qobject_input_check_struct() checks we consumed the whole dictionary,
and to get here, we did.  Fix it anyway.

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>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20200505101908.6207-4-armbru@redhat.com>

target/s390x/cpu_models.c

index 8efe6ed514b707d1b08acbdc8337365ed29b2896..2fa609bffe1214cbd7237bad0e600dfaad96e457 100644 (file)
@@ -524,7 +524,7 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
             }
         }
         if (!err) {
-            visit_check_struct(visitor, errp);
+            visit_check_struct(visitor, &err);
         }
         visit_end_struct(visitor, NULL);
         visit_free(visitor);