summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-01-10 14:01:57 -0500
committerTom Rini <[email protected]>2022-01-10 14:01:57 -0500
commitfe04d885fb540b614a2f989e16e808b300ccb52e (patch)
tree613d413c36bda908658fe4c6a24fb1a61de716ce /disk
parentd637294e264adfeb29f390dfc393106fd4d41b17 (diff)
parent0dadad6d7c5769d6258baeaf1b8db843b0dfa01f (diff)
Merge branch 'next'
Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_dos.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 9e29aa6583a..94fae7166d7 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -459,10 +459,12 @@ int layout_mbr_partitions(struct disk_partition *p, int count,
ext = &p[i];
}
- if (i >= 4 && !ext) {
- printf("%s: extended partition is needed for more than 4 partitions\n",
- __func__);
- return -1;
+ if (count < 4)
+ return 0;
+
+ if (!ext) {
+ log_err("extended partition is needed for more than 4 partitions\n");
+ return -EINVAL;
}
/* calculate extended volumes start and size if needed */