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
This commit is contained in:
Yann Gautier 2022-03-04 11:08:47 +01:00
parent b298d4df5e
commit 175758b277
1 changed files with 9 additions and 2 deletions

View File

@ -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() ==