Explorar o código

[MTD] Don't oops when the RedBoot partition table is empty

This fixes a regression with the RedBoot parsing code introduced by
commit 0b47d654089c5ce3f2ea26a4485db9bcead1e515

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Martin Michlmayr %!s(int64=19) %!d(string=hai) anos
pai
achega
678c857f3c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/mtd/redboot.c

+ 1 - 1
drivers/mtd/redboot.c

@@ -122,7 +122,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
 				}
 				}
 			}
 			}
 			break;
 			break;
-		} else {
+		} else if (buf[i].size != -1) {
 			/* re-calculate of real numslots */
 			/* re-calculate of real numslots */
 			numslots = buf[i].size / sizeof(struct fis_image_desc);
 			numslots = buf[i].size / sizeof(struct fis_image_desc);
 		}
 		}