diff options
author | Yann Gautier <yann.gautier@st.com> | 2022-03-04 11:08:47 +0100 |
---|---|---|
committer | Yann Gautier <yann.gautier@st.com> | 2022-03-04 13:48:53 +0100 |
commit | 175758b2777eb6df3c4aefd79448e97e76a15272 (patch) | |
tree | 2f3c4a4e472e83f2c8865174661e06ff982c64eb /drivers/st | |
parent | b298d4df5efc5d7a350dc10ca10b85a91d4d46e0 (diff) | |
download | arm-trusted-firmware-175758b2777eb6df3c4aefd79448e97e76a15272.tar.gz |
fix(st-clock): initialize pllcfg table
The issue was found by Coverity:
CID 376582: (UNINIT)
Using uninitialized value "*pllcfg[_PLL4]" when calling
"stm32mp1_check_pll_conf".
CID 376582: (UNINIT)
Using uninitialized value "*pllcfg[_PLL3]" when calling
"stm32mp1_check_pll_conf".
Check PLL configs are valid before using pllcfg.
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I49de849eaf451d0c165a8eb8555112a0a4140bbc
Diffstat (limited to 'drivers/st')
-rw-r--r-- | drivers/st/clk/stm32mp1_clk.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/st/clk/stm32mp1_clk.c b/drivers/st/clk/stm32mp1_clk.c index 22883488e..534ee3b1b 100644 --- a/drivers/st/clk/stm32mp1_clk.c +++ b/drivers/st/clk/stm32mp1_clk.c @@ -1921,14 +1921,21 @@ int stm32mp1_clk_init(void) if ((mmio_read_32(rcc_base + RCC_MP_RSTSCLRR) & RCC_MP_RSTSCLRR_MPUP0RSTF) != 0) { - pll3_preserve = stm32mp1_check_pll_conf(_PLL3, + if (pllcfg_valid[_PLL3]) { + pll3_preserve = + stm32mp1_check_pll_conf(_PLL3, clksrc[CLKSRC_PLL3], pllcfg[_PLL3], plloff[_PLL3]); - pll4_preserve = stm32mp1_check_pll_conf(_PLL4, + } + + if (pllcfg_valid[_PLL4]) { + pll4_preserve = + stm32mp1_check_pll_conf(_PLL4, clksrc[CLKSRC_PLL4], pllcfg[_PLL4], plloff[_PLL4]); + } } /* Don't initialize PLL4, when used by BOOTROM */ if ((stm32mp_get_boot_itf_selected() == |