Re: [PATCH] memory: stm32_omm: initialize ret in stm32_omm_set_amcr
From: Patrice CHOTARD
Date: Thu Jun 18 2026 - 02:52:15 EST
On 6/17/26 20:22, Ruoyu Wang wrote:
> stm32_omm_set_amcr() returns ret after checking whether the AMCR value
> matches the device tree description. On the normal matching path ret is
> not otherwise assigned, so initialize it to 0 before the checks.
>
> Signed-off-by: Ruoyu Wang <ruoyuw560@xxxxxxxxx>
> ---
> drivers/memory/stm32_omm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/memory/stm32_omm.c b/drivers/memory/stm32_omm.c
> index 5d06623f3f689..2a1af229d2444 100644
> --- a/drivers/memory/stm32_omm.c
> +++ b/drivers/memory/stm32_omm.c
> @@ -47,7 +47,7 @@ static int stm32_omm_set_amcr(struct device *dev, bool set)
> struct device_node *node;
> struct resource res, res1;
> unsigned int syscon_args[2];
> - int ret, idx;
> + int ret = 0, idx;
> unsigned int i, amcr, read_amcr;
>
> for (i = 0; i < omm->nb_child; i++) {
Hi Ruoyu
Reviewed-by: Patrice Chotard <patrice.chotard@xxxxxxxxxxx>
Thanks
Patrice