hw/core/machine-smp: Initialize caches_bitmap before reading
authorZhao Liu <zhao1.liu@intel.com>
Sun, 10 Nov 2024 15:09:00 +0000 (23:09 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 Nov 2024 17:38:25 +0000 (18:38 +0100)
commit9c2644948c71db61a04f22398cde72224a98267a
treef5dd869aad926adf3f39bba163b11302e3fa5a5c
parent19d542cc0bce0b3641e80444374f9ffd8294a15b
hw/core/machine-smp: Initialize caches_bitmap before reading

The caches_bitmap is defined in machine_parse_smp_cache(), but it was
not initialized.

Initialize caches_bitmap by clearing all its bits to zero.

Resolves: Coverity CID 1565389
Fixes: 4e88e7e3403d ("qapi/qom: Define cache enumeration and properties 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-2-zhao1.liu@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/core/machine-smp.c