hw/core/machine-smp: Fix error message parameter
authorZhao Liu <zhao1.liu@intel.com>
Sun, 10 Nov 2024 15:09:01 +0000 (23:09 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 Nov 2024 17:38:25 +0000 (18:38 +0100)
In the loop checking smp cache support, the error message should report
the current cache level and type.

Fix the parameter of error_setg() to ensure it reports the correct cache
level and type.

Resolves: Coverity CID 1565391
Fixes: f35c0221fef8 ("hw/core: Check smp cache topology support for machine")
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/r/20241110150901.130647-3-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/core/machine-smp.c

index b87637c78f6f35f5fa0a963285b62d4d8ea445af..b954eb84902720a3aeffa18a22befb4410eddafc 100644 (file)
@@ -317,7 +317,7 @@ bool machine_parse_smp_cache(MachineState *ms,
             !mc->smp_props.cache_supported[props->cache]) {
             error_setg(errp,
                        "%s cache topology not supported by this machine",
-                       CacheLevelAndType_str(node->value->cache));
+                       CacheLevelAndType_str(props->cache));
             return false;
         }