This is an automated email from the ASF dual-hosted git repository. jerpelea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 839d17b48d75efe4320fe0a7699e5a5bad19c762 Author: chao an <[email protected]> AuthorDate: Wed Oct 28 13:42:14 2026 +0800 drivers/timer: Avoid disabled signal notifications Timer and oneshot callbacks may run with SIGEV_NONE configured. Skip nxsig_notification in that case instead of entering the generic signal notification path only to return without delivering anything. Signed-off-by: chao an <[email protected]> --- drivers/timers/oneshot.c | 8 ++++++-- drivers/timers/timer.c | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/timers/oneshot.c b/drivers/timers/oneshot.c index 1fcd1dfa572..9dceffffe6d 100644 --- a/drivers/timers/oneshot.c +++ b/drivers/timers/oneshot.c @@ -109,8 +109,11 @@ static void oneshot_callback(FAR struct oneshot_lowerhalf_s *lower, /* Signal the waiter.. if there is one */ - nxsig_notification(priv->od_pid, &priv->od_event, SI_QUEUE, - &priv->od_work); + if (priv->od_event.sigev_notify != SIGEV_NONE) + { + nxsig_notification(priv->od_pid, &priv->od_event, SI_QUEUE, + &priv->od_work); + } } #endif @@ -189,6 +192,7 @@ static int oneshot_ioctl(FAR struct file *filep, int cmd, unsigned long arg) case OSIOC_MAXDELAY: { FAR struct timespec *ts = (FAR struct timespec *)((uintptr_t)arg); + DEBUGASSERT(ts != NULL); ret = ONESHOT_MAX_DELAY(priv->od_lower, ts); diff --git a/drivers/timers/timer.c b/drivers/timers/timer.c index 2307d678865..f7a782938e5 100644 --- a/drivers/timers/timer.c +++ b/drivers/timers/timer.c @@ -133,7 +133,11 @@ static bool timer_notifier(FAR uint32_t *next_interval_us, FAR void *arg) poll_notify(&upper->fds, 1, POLLIN); } - nxsig_notification(notify->pid, ¬ify->event, SI_QUEUE, &upper->work); + if (notify->event.sigev_notify != SIGEV_NONE) + { + nxsig_notification(notify->pid, ¬ify->event, SI_QUEUE, + &upper->work); + } return notify->periodic; }
