mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean-Marc Eurin <jmeurin@google.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	Jean-Marc Eurin <jmeurin@google.com>
Subject: [PATCH] Fix the size of the header read buffer.
Date: Fri, 28 Jan 2022 14:01:56 -0800	[thread overview]
Message-ID: <20220128220156.4057446-1-jmeurin@google.com> (raw)

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>
---
 drivers/mtd/mtdoops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 227df24387df..09a26747f490 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -223,7 +223,7 @@ static void find_next_position(struct mtdoops_context *cxt)
 {
 	struct mtd_info *mtd = cxt->mtd;
 	int ret, page, maxpos = 0;
-	u32 count[2], maxcount = 0xffffffff;
+	u32 count[MTDOOPS_HEADER_SIZE/sizeof(u32)], maxcount = 0xffffffff;
 	size_t retlen;
 
 	for (page = 0; page < cxt->oops_pages; page++) {
-- 
2.35.0.rc2.247.g8bbb082509-goog


             reply	other threads:[~2022-01-28 22:02 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 22:01 Jean-Marc Eurin [this message]
2022-01-31 10:00 ` Miquel Raynal
2022-02-04  1:53   ` [PATCH v2] mtdoops: " Jean-Marc Eurin
2022-02-07 15:34     ` Miquel Raynal
2022-03-30 18:28       ` [PATCH] " Jean-Marc Eurin
2022-03-30 18:28         ` [PATCH v2 0/2] mtd: mtdoops: Structure the header of the dumped oops Jean-Marc Eurin
2022-03-30 18:28         ` [PATCH v2 1/2] mtd: mtdoops: Fix the size of the header read buffer Jean-Marc Eurin
2022-03-30 18:28         ` [PATCH v2 2/2] mtd: mtdoops: Create a header structure for the saved mtdoops Jean-Marc Eurin
2022-03-30 22:23           ` kernel test robot
2022-03-31  0:14           ` kernel test robot
2022-03-30 19:59         ` [PATCH] Fix the size of the header read buffer Jean-Marc Eurin
2022-04-15  0:13       ` [PATCH v3 0/3] mtd: mtdoops: Add timestamp to the dumped oops header Jean-Marc Eurin
2022-04-15  0:13         ` [PATCH v3 1/3] mtd: mtdoops: Fix the size of the header read buffer Jean-Marc Eurin
2022-04-21  7:35           ` Miquel Raynal
2022-04-15  0:13         ` [PATCH v3 2/3] mtd: mtdoops: Create a header structure for the saved mtdoops Jean-Marc Eurin
2022-04-21  7:35           ` Miquel Raynal
2022-04-15  0:13         ` [PATCH v3 3/3] mtd: mtdoops: Add a timestamp to the mtdoops header Jean-Marc Eurin
2022-04-21  7:35           ` Miquel Raynal
2022-04-21 23:42         ` [PATCH v4 0/3] mtd: mtdoops: Add timestamp to the dumped oops header Jean-Marc Eurin
2022-04-21 23:42           ` [PATCH v4 1/3] mtd: mtdoops: Fix the size of the header read buffer Jean-Marc Eurin
2022-04-26  7:34             ` Miquel Raynal
2022-04-21 23:42           ` [PATCH v4 2/3] mtd: mtdoops: Create a header structure for the saved mtdoops Jean-Marc Eurin
2022-04-26  7:34             ` Miquel Raynal
2022-04-25  8:42           ` [PATCH v4 0/3] mtd: mtdoops: Add timestamp to the dumped oops header Miquel Raynal
2022-04-25 16:14             ` Jean-Marc Eurin
2022-04-26  7:28               ` Miquel Raynal
2022-04-25 16:09         ` [PATCH v4 3/3] mtd: mtdoops: Add a timestamp to the mtdoops header Jean-Marc Eurin
2022-04-26  7:34           ` Miquel Raynal

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=20220128220156.4057446-1-jmeurin@google.com \
    --to=jmeurin@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /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

Powered by JetHome