This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new c28c14ad26 sched/wdog/wd_cancel: Return 0 (OK) when cancelling an 
inactive wdog
c28c14ad26 is described below

commit c28c14ad266837b4b8f91b26e3171dbb18f33df1
Author: Jukka Laitinen <jukka.laiti...@tii.ae>
AuthorDate: Wed May 14 12:17:14 2025 +0300

    sched/wdog/wd_cancel: Return 0 (OK) when cancelling an inactive wdog
    
    In case the wdog has already completed when calling cancel, the cancel is
    supposed to just return OK.
    
    Signed-off-by: Jukka Laitinen <jukka.laiti...@tii.ae>
---
 sched/wdog/wd_cancel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sched/wdog/wd_cancel.c b/sched/wdog/wd_cancel.c
index ae8f80cc7c..bace89303c 100644
--- a/sched/wdog/wd_cancel.c
+++ b/sched/wdog/wd_cancel.c
@@ -70,7 +70,7 @@ int wd_cancel(FAR struct wdog_s *wdog)
   if (wdog == NULL || !WDOG_ISACTIVE(wdog))
     {
       spin_unlock_irqrestore(&g_wdspinlock, flags);
-      return -EINVAL;
+      return wdog == NULL ? -EINVAL : 0;
     }
 
   sched_note_wdog(NOTE_WDOG_CANCEL, (FAR void *)wdog->func,

Reply via email to