sched/wdog: Fix list traversal problem in nested wdog process
If g_wdactivelist has been changed in the wdog callback, the list traversal with next pointer will cause problem. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com> Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
ebf7f5f748
commit
50f801dfaa
@ -91,16 +91,16 @@
|
|||||||
static inline_function void wd_expiration(clock_t ticks)
|
static inline_function void wd_expiration(clock_t ticks)
|
||||||
{
|
{
|
||||||
FAR struct wdog_s *wdog;
|
FAR struct wdog_s *wdog;
|
||||||
FAR struct wdog_s *next;
|
|
||||||
wdentry_t func;
|
wdentry_t func;
|
||||||
|
|
||||||
/* Process the watchdog at the head of the list as well as any
|
/* Process the watchdog at the head of the list as well as any
|
||||||
* other watchdogs that became ready to run at this time
|
* other watchdogs that became ready to run at this time
|
||||||
*/
|
*/
|
||||||
|
|
||||||
list_for_every_entry_safe(&g_wdactivelist, wdog,
|
while (!list_is_empty(&g_wdactivelist))
|
||||||
next, struct wdog_s, node)
|
|
||||||
{
|
{
|
||||||
|
wdog = list_first_entry(&g_wdactivelist, struct wdog_s, node);
|
||||||
|
|
||||||
/* Check if expected time is expired */
|
/* Check if expected time is expired */
|
||||||
|
|
||||||
if (!clock_compare(wdog->expired, ticks))
|
if (!clock_compare(wdog->expired, ticks))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user