[PATCH] drivers: rtc: fix null pointer access in armada38x_rtc_reset

Stefan Roese sr at denx.de
Fri Mar 4 08:36:58 CET 2022


On 2/28/22 10:31, fberder at outlook.fr wrote:
> From: Francois Berder <fberder at outlook.fr>
> 
> Replace null pointer by pointer to device registers when calling
> armada38x_rtc_write.
> 
> Signed-off-by: Francois Berder <fberder at outlook.fr>

Reviewed-by: Stefan Roese <sr at denx.de>

Thanks,
Stefan


> ---
> 
>   drivers/rtc/armada38x.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/armada38x.c b/drivers/rtc/armada38x.c
> index 2d264acf77..2af64e3912 100644
> --- a/drivers/rtc/armada38x.c
> +++ b/drivers/rtc/armada38x.c
> @@ -121,7 +121,7 @@ static int armada38x_rtc_reset(struct udevice *dev)
>   		armada38x_rtc_write(0, rtc, RTC_CONF_TEST);
>   		mdelay(500);
>   		armada38x_rtc_write(0, rtc, RTC_TIME);
> -		armada38x_rtc_write(BIT(0) | BIT(1), 0, RTC_STATUS);
> +		armada38x_rtc_write(BIT(0) | BIT(1), rtc, RTC_STATUS);
>   	}
>   
>   	return 0;

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list