casaroli commented on code in PR #20387: URL: https://github.com/apache/nuttx/pull/20387#discussion_r4133886991
########## sched/wdog/wd_cancel.c: ########## @@ -64,7 +64,11 @@ int wd_cancel(FAR struct wdog_s *wdog) irqstate_t flags; int ret = -EINVAL; - if (wdog != NULL) + /* An inactive watchdog needs no lock. A concurrent start is the same + * as a start just after this cancel. + */ + + if (wdog != NULL && WDOG_ISACTIVE(wdog)) Review Comment: You are right. I did not account for SMP. I updated to check `WDOG_ISACTIVE()` in the callers that already hold the critical section instead. Please take another look. Thank you. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
