All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: opensbi@lists.infradead.org
Subject: [PATCH 1/1] platform: generic: allwinner: avoid buffer overrun
Date: Tue, 27 Dec 2022 19:39:25 +0100	[thread overview]
Message-ID: <87v8lwd736.fsf@igel.home> (raw)
In-Reply-To: <da726834-79af-8e40-c39e-a6dd4c421ea4@sholland.org> (Samuel Holland's message of "Tue, 27 Dec 2022 12:22:22 -0600")

On Dez 27 2022, Samuel Holland wrote:

> Anything else is either wrong or wasting space.

Not wasting space:

diff --git a/lib/utils/irqchip/plic.c b/lib/utils/irqchip/plic.c
index d633514..901ffaa 100644
--- a/lib/utils/irqchip/plic.c
+++ b/lib/utils/irqchip/plic.c
@@ -39,14 +39,14 @@ static void plic_set_priority(const struct plic_data *plic, u32 source, u32 val)
 void plic_priority_save(const struct plic_data *plic, u8 *priority, u32 num)
 {
 	for (u32 i = 1; i <= num; i++)
-		priority[i] = plic_get_priority(plic, i);
+		priority[i - 1] = plic_get_priority(plic, i);
 }
 
 void plic_priority_restore(const struct plic_data *plic, const u8 *priority,
 			   u32 num)
 {
 	for (u32 i = 1; i <= num; i++)
-		plic_set_priority(plic, i, priority[i]);
+		plic_set_priority(plic, i, priority[i - 1]);
 }
 
 static u32 plic_get_thresh(const struct plic_data *plic, u32 cntxid)

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


  reply	other threads:[~2022-12-27 18:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 11:01 [PATCH 1/1] platform: generic: allwinner: avoid buffer overrun Heinrich Schuchardt
2022-12-27 11:46 ` Bin Meng
2022-12-27 12:01   ` Heinrich Schuchardt
2022-12-27 12:07     ` Bin Meng
2022-12-27 13:03       ` Andreas Schwab
2022-12-27 13:13         ` Bin Meng
2022-12-27 13:36           ` Andreas Schwab
2022-12-27 13:49             ` Bin Meng
2022-12-27 14:06               ` Andreas Schwab
2022-12-27 18:22           ` Samuel Holland
2022-12-27 18:39             ` Andreas Schwab [this message]
2022-12-27 18:49               ` Samuel Holland
2022-12-27 18:52                 ` Andreas Schwab
2022-12-27 19:12                   ` Samuel Holland
2022-12-27 19:31                     ` Andreas Schwab
2022-12-27 12:05 ` Andreas Schwab
2022-12-27 12:28   ` Heinrich Schuchardt
2022-12-27 12:41     ` Bin Meng
2023-01-13 12:04 ` Anup Patel

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=87v8lwd736.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=opensbi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.