From: Simon Glass Date: Sat, 23 Oct 2021 23:26:01 +0000 (-0600) Subject: mbr: Correct verification check X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-logo.png?a=commitdiff_plain;h=362a79f3e8582138545d408a56d4accf35e894b3;p=u-boot.git 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 Acked-by: Ilias Apalodimas --- diff --git a/cmd/mbr.c b/cmd/mbr.c index e7e2298096..c269833eb8 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;