mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 2/3] pstore: fix size of OF fixup memory region
Date: Mon,  6 May 2024 18:02:45 +0200	[thread overview]
Message-ID: <20240506160246.2198975-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240506160246.2198975-1-a.fatoum@pengutronix.de>

struct resource::end points at the last byte of a region, but we pointed
1 byte after it instead. Fix this, so we have a proper (aligned) size
for the memory region.

It's possible this had no adverse effect.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 fs/pstore/ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 4732bd4e3154..9ecf7ef5e901 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -478,7 +478,7 @@ static int ramoops_of_fixup(struct device_node *root, void *data)
 	int ret;
 
 	res.start = pdata->mem_address;
-	res.end = res.start + pdata->mem_size;
+	res.end = res.start + pdata->mem_size - 1;
 	res.name = "ramoops";
 
 	ret = of_fixup_reserved_memory(root, &res);
-- 
2.39.2




  reply	other threads:[~2024-05-06 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 16:02 [PATCH master 1/3] pstore: ramoops: fix use of wrong types on 64-bit Ahmad Fatoum
2024-05-06 16:02 ` Ahmad Fatoum [this message]
2024-05-06 16:02 ` [PATCH master 3/3] pstore: return -ENOENT when file is missing Ahmad Fatoum
2024-05-07  7:33 ` [PATCH master 1/3] pstore: ramoops: fix use of wrong types on 64-bit Sascha Hauer

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=20240506160246.2198975-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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