mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
sched/wdog/wd_start.c: prevent accessing watch-dog lag if head is NULL
If statement in line 103 could acces wdactivelist.head->lag when head was NULL which could result in hard fault. The statement was also redundant as the same condition is checked in the while loop below. This change remove the if statement to prevent hard fault to occur. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
committed by
David Sidrane
parent
df088c39f0
commit
cdfe7b5a54
@@ -98,10 +98,6 @@ static inline void wd_expiration(void)
|
|||||||
FAR struct wdog_s *wdog;
|
FAR struct wdog_s *wdog;
|
||||||
wdentry_t func;
|
wdentry_t func;
|
||||||
|
|
||||||
/* Check if the watchdog at the head of the list is ready to run */
|
|
||||||
|
|
||||||
if (((FAR struct wdog_s *)g_wdactivelist.head)->lag <= 0)
|
|
||||||
{
|
|
||||||
/* 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
|
||||||
*/
|
*/
|
||||||
@@ -132,7 +128,6 @@ static inline void wd_expiration(void)
|
|||||||
up_setpicbase(wdog->picbase);
|
up_setpicbase(wdog->picbase);
|
||||||
CALL_FUNC(func, wdog->arg);
|
CALL_FUNC(func, wdog->arg);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user