Skip to content

Commit 0597f21

Browse files
author
Srinivasulu Thanneeru
committed
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 <[email protected]>
1 parent 6e176c0 commit 0597f21

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/cxl/core/mbox.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,7 @@ int cxl_dev_dc_identify(struct cxl_mailbox *mbox,
17021702
/* Read and check all partition information for validity and potential
17031703
* debugging; see debug output in cxl_dc_check() */
17041704
start_partition = 0;
1705+
num_partitions = 0;
17051706
do {
17061707
int rc, i, j;
17071708

0 commit comments

Comments
 (0)