diff --git a/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c b/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c index e2cc68aec95..8c13c0ec9f8 100644 --- a/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c +++ b/core/arch/arm/plat-stm32mp1/drivers/stm32mp1_pmic.c @@ -542,8 +542,10 @@ static TEE_Result release_voltage_lists(void) for (n = 0; n < ARRAY_SIZE(pmic_regulators); n++) { struct pmic_regulator_data *priv = pmic_regulators[n].priv; - if (priv && priv->voltages_level) + if (priv && priv->voltages_level) { free(priv->voltages_level); + priv->voltages_level = NULL; + } } return TEE_SUCCESS;