On 08/05/26 19:50, Shivang Upadhyay wrote:

Fix Coverity CID 1658041 by using designated initializers to prevent
uninitialized memory from being written to guest.

Cc: Aditya Gupta <[email protected]>
Cc: Harsh Prateek Bora <[email protected]>
Reported-by: Peter Maydell <[email protected]>
Suggested-by: Peter Maydell <[email protected]>
Signed-off-by: Shivang Upadhyay <[email protected]>"
---
  hw/ppc/pnv.c | 16 ++++------------
  1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 9ed918fa6a..c0afef8197 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -838,18 +838,10 @@ static void pnv_reset(MachineState *machine, ResetType 
type)
           * crash
           */
- MpiplProcDumpArea proc_area;
-
-        proc_area.version = PROC_DUMP_AREA_VERSION_P9;
-        proc_area.thread_size = cpu_to_be32(sizeof(MpiplPreservedCPUState));
-
-        /* These are to be allocated & assigned by the firmware */
-        proc_area.alloc_addr = 0;
-        proc_area.alloc_size = 0;
-
-        /* These get assigned after crash, when QEMU preserves the registers */
-        proc_area.dest_addr = 0;
-        proc_area.act_size = 0;
+        MpiplProcDumpArea proc_area = {
+            .version = PROC_DUMP_AREA_VERSION_P9,
+            .thread_size = cpu_to_be32(sizeof(MpiplPreservedCPUState)),
+        };

Thanks for the fix, shivang.

Reviewed-by: Aditya Gupta <[email protected]>


- Aditya G


Reply via email to