aboutsummaryrefslogtreecommitdiff
path: root/cmd/mbr.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-10-23 17:26:01 -0600
committerSimon Glass <sjg@chromium.org>2021-11-28 16:51:51 -0700
commit362a79f3e8582138545d408a56d4accf35e894b3 (patch)
tree0692150833dfeafc8237b52a0589028b0bf11892 /cmd/mbr.c
parentce34a6653f15ae2a342805e384370325625f9f1a (diff)
downloadu-boot-362a79f3e8582138545d408a56d4accf35e894b3.zip
u-boot-362a79f3e8582138545d408a56d4accf35e894b3.tar.gz
u-boot-362a79f3e8582138545d408a56d4accf35e894b3.tar.bz2
mbr: Correct verification check
At present this command considers the partitions to be identical if the start and size are smaller than expected. It should check that they are the same. Fix this and tidy up the code style a little. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'cmd/mbr.c')
-rw-r--r--cmd/mbr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/mbr.c b/cmd/mbr.c
index e7e2298..c269833 100644
--- a/cmd/mbr.c
+++ b/cmd/mbr.c
@@ -244,12 +244,12 @@ static int do_verify_mbr(struct blk_desc *dev, const char *str)
for (i = 0; i < count; i++) {
struct disk_partition p;
- if (part_get_info(dev, i+1, &p))
+ if (part_get_info(dev, i + 1, &p))
goto fail;
- if ((partitions[i].size && p.size < partitions[i].size) ||
- (partitions[i].start && p.start < partitions[i].start) ||
- (p.sys_ind != partitions[i].sys_ind))
+ if ((partitions[i].size && p.size != partitions[i].size) ||
+ (partitions[i].start && p.start != partitions[i].start) ||
+ p.sys_ind != partitions[i].sys_ind)
goto fail;
}
ret = 0;