From 0597f21a4d24d5c3eab0acc4d1cc26896a2b97c4 Mon Sep 17 00:00:00 2001 From: Srinivasulu Thanneeru Date: Mon, 1 Sep 2025 23:04:42 -0700 Subject: [PATCH] cxl/region: Fix uninitialized num_partitions causing incorrect results Initialize num_partitions to zero before parsing partition info in cxl_dev_dc_identify(). Uninitialized value could lead to random data and incorrect results during partition validation. Signed-off-by: Srinivasulu Thanneeru --- drivers/cxl/core/mbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c index 891a213ce7be..020d04c05ac4 100644 --- a/drivers/cxl/core/mbox.c +++ b/drivers/cxl/core/mbox.c @@ -1702,6 +1702,7 @@ int cxl_dev_dc_identify(struct cxl_mailbox *mbox, /* Read and check all partition information for validity and potential * debugging; see debug output in cxl_dc_check() */ start_partition = 0; + num_partitions = 0; do { int rc, i, j;