[PATCH for 9.2 2/2] hw/core/machine-smp: Fix error message parameter

Zhao Liu posted 2 patches 1 week, 6 days ago
[PATCH for 9.2 2/2] hw/core/machine-smp: Fix error message parameter
Posted by Zhao Liu 1 week, 6 days ago
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>
---
 hw/core/machine-smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c
index b87637c78f6f..b954eb849027 100644
--- a/hw/core/machine-smp.c
+++ b/hw/core/machine-smp.c
@@ -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;
         }
 
-- 
2.34.1
Re: [PATCH for 9.2 2/2] hw/core/machine-smp: Fix error message parameter
Posted by Philippe Mathieu-Daudé 4 days, 4 hours ago
On 10/11/24 16:09, Zhao Liu wrote:
> 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>
> ---
>   hw/core/machine-smp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>