drivers: counter: Fix possible null pointer dereference
The function counter_rz_gtm_set_alarm was accessing alarm_cfg->flags and
alarm_cfg->ticks before verifying that alarm_cfg is non-NULL.
This could lead to undefined behavior or crashes if a NULL pointer is
passed.
The pointer check has been moved before any dereference to fix this bug.
Signed-off-by:
Gaetan Perrot <gaetan.perrot@spacecubics.com>
Loading
Please sign in to comment