Skip to content
Commit f1c27b6e authored by Gaetan Perrot's avatar Gaetan Perrot Committed by Daniel DeGrasse
Browse files

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: default avatarGaetan Perrot <gaetan.perrot@spacecubics.com>
parent 80df24e3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment