Skip to content

Commit 80aabe4

Browse files
authored
Update part_driver_mbr.c check valid MBR
1 parent d4d1b8c commit 80aabe4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

iop/fs/bdm/src/part_driver_mbr.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@ int part_connect_mbr(struct block_device *bd)
8383
return rval;
8484
}
8585

86-
// Loop and parse the primary partition entries in the MBR block.
87-
printf("Found MBR disk\n");
88-
86+
8987
valid_partitions = partitions_sanity_check_mbr(bd, pMbrBlock);
9088

91-
printf("MBR disk valid_partitions=%d \n", valid_partitions);
92-
9389
//Most likely a VBR
9490
if(valid_partitions == 0) {
91+
printf("MBR disk valid_partitions=%d \n", valid_partitions);
9592
FreeSysMemory(pMbrBlock);
9693
return -1;
9794
}
98-
95+
96+
printf("Found MBR disk\n");
97+
98+
// Loop and parse the primary partition entries in the MBR block.
9999
for (int i = 0; i < 4; i++)
100100
{
101101
// Check if the partition is active, checking the status bit is not reliable so check if the sector_count is greater than zero instead.
@@ -114,7 +114,6 @@ int part_connect_mbr(struct block_device *bd)
114114
{
115115
// No more free partition slots.
116116
printf("Can't mount partition, no more free partition slots!\n");
117-
FreeSysMemory(pMbrBlock);
118117
continue;
119118
}
120119

0 commit comments

Comments
 (0)