Skip to contentSkip to conversation

mtd/redboot: Handle holes in fis table

PATCH New Peter Korsgaard 1 participant 1 message Mar 20, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd/redboot: Handle holes in fis table

Hi,

Redboot simply sets the first character of a fis entry to 0xff on "fis delete". The kernel redboot parser stops parsing on such an entry, and without this patch any entries after a deleted image would not be detected.

--

 drivers/mtd/redboot.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/mtd/redboot.c +1 -5
Index: linux/drivers/mtd/redboot.c
===================================================================
@@ -85,10 +85,6 @@
 
 	numslots = (master->erasesize / sizeof(struct fis_image_desc));
 	for (i = 0; i < numslots; i++) {
-		if (buf[i].name[0] == 0xff) {
-			i = numslots;
-			break;
-		}
 		if (!memcmp(buf[i].name, "FIS directory", 14)) {
 			/* This is apparently the FIS directory entry for the
 			 * FIS directory itself.  The FIS directory size is
@@ -128,7 +124,7 @@
 		struct fis_list *new_fl, **prev;
 
 		if (buf[i].name[0] == 0xff)
-			break;
+			continue;
 		if (!redboot_checksum(&buf[i]))
 			break;
 
Signature · 1 line
Bye, Peter Korsgaard