Bug fix in the SP804 dual timer driver
The generic delay timer driver expects a pointer to a timer_ops_t
structure containing the specific timer driver information. It
doesn't make a copy of the structure, instead it just keeps the
pointer. Therefore, this pointer must remain valid over time.

The SP804 driver doesn't satisfy this requirement. The
sp804_timer_init() macro creates a temporary instanciation of the
timer_ops_t structure on the fly and passes it to the generic
delay timer. When this temporary instanciation gets deallocated,
the generic delay timer is left with a pointer to invalid data.

This patch fixes this bug by statically allocating the SP804
timer_ops_t structure.

Change-Id: I8fbf75907583aef06701e3fd9fabe0b2c9bc95bf
1 parent 7dc28e9 commit 543128771c59e9f1ee91c245d342e929d5ba7fa1
@Sandrine Bailleux Sandrine Bailleux authored on 28 Sep 2015
Showing 1 changed file
View
include/drivers/arm/sp804_delay_timer.h