Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=11192146e57bc8e58865e7d9c2497f66a4f7e6e7
Commit:     11192146e57bc8e58865e7d9c2497f66a4f7e6e7
Parent:     a2593247d747954cd12c32da8c5a3aecb9cd19a3
Author:     Rod Whitby <[EMAIL PROTECTED]>
AuthorDate: Sat Feb 10 09:26:48 2007 +0000
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Sat Feb 10 09:26:48 2007 +0000

    [MTD] Fix RedBoot partition parsing regression harder.
    
    Correct the location of the recalculation of the FIS directory size,
    and also add the same recalculation for the byte-swapped case.
    
    Signed-off-by: Rod Whitby <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 drivers/mtd/redboot.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c
index 5a31f49..a459ffa 100644
--- a/drivers/mtd/redboot.c
+++ b/drivers/mtd/redboot.c
@@ -96,6 +96,8 @@ static int parse_redboot_partitions(struct mtd_info *master,
                         */
                        if (swab32(buf[i].size) == master->erasesize) {
                                int j;
+                               /* Update numslots based on actual FIS 
directory size */
+                               numslots = swab32(buf[i].size) / sizeof (struct 
fis_image_desc);
                                for (j = 0; j < numslots; ++j) {
 
                                        /* A single 0xff denotes a deleted 
entry.
@@ -120,11 +122,11 @@ static int parse_redboot_partitions(struct mtd_info 
*master,
                                        swab32s(&buf[j].desc_cksum);
                                        swab32s(&buf[j].file_cksum);
                                }
+                       } else {
+                               /* Update numslots based on actual FIS 
directory size */
+                               numslots = buf[i].size / sizeof(struct 
fis_image_desc);
                        }
                        break;
-               } else if (buf[i].size != -1) {
-                       /* re-calculate of real numslots */
-                       numslots = buf[i].size / sizeof(struct fis_image_desc);
                }
        }
        if (i == numslots) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to