[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/11] s390x/cpumodel: Fix harmless misuse of visit_check_str
From: |
David Hildenbrand |
Subject: |
Re: [PATCH 03/11] s390x/cpumodel: Fix harmless misuse of visit_check_struct() |
Date: |
Mon, 27 Apr 2020 10:02:16 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 24.04.20 21:20, Markus Armbruster wrote:
> Commit e47970f51d "s390x/cpumodel: Fix query-cpu-model-FOO error API
> violations" neglected to change visit_end_struct()'s Error ** argument
> along with the others. If visit_end_struct() failed, we'd take the
s/visit_end_struct/visit_check_struct/ ?
> 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.
AFAIKs, if visit_check_struct() failed, we'd still do the memcopy, but
also report the error. Not nice, not bad.
Reviewed-by: David Hildenbrand <address@hidden>
>
> Cc: David Hildenbrand <address@hidden>
> Cc: Cornelia Huck <address@hidden>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> target/s390x/cpu_models.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 7c32180269..87a8028ad3 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -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);
>
--
Thanks,
David / dhildenb
- [PATCH 05/11] tests/migration: Tighten error checking, (continued)
- [PATCH 07/11] mips/malta: Fix create_cps() error handling, Markus Armbruster, 2020/04/24
- [PATCH 03/11] s390x/cpumodel: Fix harmless misuse of visit_check_struct(), Markus Armbruster, 2020/04/24
- Re: [PATCH 03/11] s390x/cpumodel: Fix harmless misuse of visit_check_struct(),
David Hildenbrand <=
- [PATCH 10/11] arm/sabrelite: Consistently use &error_fatal in sabrelite_init(), Markus Armbruster, 2020/04/24
- [PATCH 01/11] nvdimm: Plug memory leak in uuid property setter, Markus Armbruster, 2020/04/24
- [PATCH 08/11] mips/boston: Fix boston_mach_init() error handling, Markus Armbruster, 2020/04/24
- [PATCH 11/11] i386: Fix x86_cpu_load_model() error API violation, Markus Armbruster, 2020/04/24
- [PATCH 02/11] xen: Fix and improve handling of device_add usb-host errors, Markus Armbruster, 2020/04/24