ipl/palo: Fix partition detection
Fix a bug where for partitions > 6 a wrong offset was used.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/lib/diskpart.c b/lib/diskpart.c
index 999d8ed..06f27ac 100644
--- a/lib/diskpart.c
+++ b/lib/diskpart.c
@@ -68,11 +68,11 @@
break;
}
- mptab[extnum].start = __le32_to_cpu(ptab[0].start_sect) + offset;
- mptab[extnum].length = __le32_to_cpu(ptab[0].nr_sects);
+ mptab[extnum].start = offset + (__u32)__le32_to_cpu(ptab[0].start_sect);
+ mptab[extnum].length = (__u32) __le32_to_cpu(ptab[0].nr_sects);
mptab[extnum].id = ptab[0].sys_ind;
- offset += __le32_to_cpu(ptab[1].start_sect);
+ offset = mptab[ex].start + (__u32) __le32_to_cpu(ptab[1].start_sect);
extnum++;
if (!is_extended(ptab[1].sys_ind))