Skip to content

Commit fbb83e5

Browse files
jmeurinmiquelraynal
authored andcommitted
mtd: mtdoops: Fix the size of the header read buffer.
The read buffer size depends on the MTDOOPS_HEADER_SIZE. Tested: Changed the header size, it doesn't panic, header is still read/written correctly. Signed-off-by: Jean-Marc Eurin <jmeurin@google.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220421234244.2172003-2-jmeurin@google.com
1 parent 96a3295 commit fbb83e5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/mtdoops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static void find_next_position(struct mtdoops_context *cxt)
223223
{
224224
struct mtd_info *mtd = cxt->mtd;
225225
int ret, page, maxpos = 0;
226-
u32 count[2], maxcount = 0xffffffff;
226+
u32 count[MTDOOPS_HEADER_SIZE/sizeof(u32)], maxcount = 0xffffffff;
227227
size_t retlen;
228228

229229
for (page = 0; page < cxt->oops_pages; page++) {

0 commit comments

Comments
 (0)