lkml.org 
[lkml]   [2021]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] clk: at91: fix count of periph clocks passed to pmc_data_allocate
Date
When allocating clk_hw structure, only the periph32 clocks are considered.
Since sama5d2_periphck are also added to the phws there is currently an
out of bound write. Fix this by adding the count of periphck to periph32ck.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
drivers/clk/at91/sama5d2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c
index 3d1f78176c3e..663b73a032ee 100644
--- a/drivers/clk/at91/sama5d2.c
+++ b/drivers/clk/at91/sama5d2.c
@@ -170,7 +170,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np)

sama5d2_pmc = pmc_data_allocate(PMC_AUDIOPLLCK + 1,
nck(sama5d2_systemck),
- nck(sama5d2_periph32ck),
+ nck(sama5d2_periphck) + nck(sama5d2_periph32ck),
nck(sama5d2_gck), 3);
if (!sama5d2_pmc)
return;
--
2.32.0
\
 
 \ /
  Last update: 2021-06-09 10:31    [W:0.036 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site