mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-18 18:59:13 +08:00
bsps/leon3: Fix LEON3 timer initialization
Commit 810b2d50c9 introduced a potential
NULL pointer access in the LEON3 timer initialization. Fix the
initialization order.
Update #5541.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
This commit is contained in:
@@ -217,10 +217,11 @@ static void amba_initialize(void)
|
||||
* Note that minimum value is the number of timer instances present in
|
||||
* GRTIMER/GPTIMER hardware. See HW manual.
|
||||
*/
|
||||
if (leon3_timer_prescaler)
|
||||
grlib_store_32(&LEON3_Timer_Regs->sreload, leon3_timer_prescaler);
|
||||
if (leon3_timer_prescaler) {
|
||||
grlib_store_32(timer_regs->sreload, leon3_timer_prescaler);
|
||||
}
|
||||
|
||||
LEON3_Timer_Regs = (gptimer *)DEV_TO_APB(adev)->start;
|
||||
LEON3_Timer_Regs = timer_regs;
|
||||
LEON3_Timer_Adev = adev;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user