From eb78535604011ae0f398daa1d898402d8e43b883 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Fri, 9 Mar 2018 08:35:12 +0800 Subject: [PATCH] [DFS] Add protection for pt->triggered --- components/dfs/src/poll.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/dfs/src/poll.c b/components/dfs/src/poll.c index 01d41da18b..f2f3fc4c76 100644 --- a/components/dfs/src/poll.c +++ b/components/dfs/src/poll.c @@ -20,6 +20,7 @@ * Change Logs: * Date Author Notes * 2016-12-28 Bernard first version + * 2018-03-09 Bernard Add protection for pt->triggered. */ #include @@ -118,13 +119,12 @@ static int poll_wait_timeout(struct rt_poll_table *pt, int msec) rt_hw_interrupt_enable(level); rt_schedule(); - } - else - { - rt_hw_interrupt_enable(level); + + level = rt_hw_interrupt_disable(); } ret = !pt->triggered; + rt_hw_interrupt_enable(level); return ret; }