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 5bbb7870bf372bed6d45ebc7be85e9c907700ea5 Author: chao an <[email protected]> AuthorDate: Wed Oct 28 13:41:12 2026 +0800 drivers/timer: Avoid empty poll notifications Timer callbacks call poll_notify on every expiration even when no task has registered a poll waiter. Check for a waiter first so periodic timers avoid entering the poll notification path unnecessarily. Signed-off-by: chao an <[email protected]> --- drivers/timers/timer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/timers/timer.c b/drivers/timers/timer.c index 63286494520..2307d678865 100644 --- a/drivers/timers/timer.c +++ b/drivers/timers/timer.c @@ -128,7 +128,10 @@ static bool timer_notifier(FAR uint32_t *next_interval_us, FAR void *arg) /* Signal the waiter.. if there is one */ - poll_notify(&upper->fds, 1, POLLIN); + if (upper->fds != NULL) + { + poll_notify(&upper->fds, 1, POLLIN); + } nxsig_notification(notify->pid, ¬ify->event, SI_QUEUE, &upper->work);
