mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Christopher Ebner <ch.ebner@commend.com>
To: barebox@lists.infradead.org
Cc: ch.ebner@commend.com
Subject: [PATCH] partitions: efi: Continue partition enumeration on invalid pte
Date: Mon,  5 Jun 2023 12:11:05 +0200	[thread overview]
Message-ID: <20230605101105.485283-1-ch.ebner@commend.com> (raw)

The efi partition enumeration stops, if a partition entry is
invalid or non-existent.
Later partitions which would be valid are therefore not enumerated.
This can be the case, eg. if a device with the following
partitions is enumerated: p1, p2, p4, p5, p6.
Skipping the invalid entry instead of exiting the enumeration fixes
this problem.

Signed-off-by: Christopher Ebner <ch.ebner@commend.com>
---
 common/partitions/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/partitions/efi.c b/common/partitions/efi.c
index ffdbd9a56f..0411a8b248 100644
--- a/common/partitions/efi.c
+++ b/common/partitions/efi.c
@@ -460,7 +460,7 @@ static void efi_partition(void *buf, struct block_device *blk,
 	for (i = 0; i < nb_part; i++) {
 		if (!is_pte_valid(&ptes[i], last_lba(blk))) {
 			dev_dbg(blk->dev, "Invalid pte %d\n", i);
-			return;
+			continue;
 		}
 
 		pentry = &pd->parts[pd->used_entries];
-- 
2.25.1




             reply	other threads:[~2023-06-05 10:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 10:11 Christopher Ebner [this message]
2023-06-06  9:46 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230605101105.485283-1-ch.ebner@commend.com \
    --to=ch.ebner@commend.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox