You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2020/01/22 09:05:39 UTC

[incubator-nuttx] branch master updated: kwork/notifier: initialize the work handler

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5a53ed6  kwork/notifier: initialize the work handler
5a53ed6 is described below

commit 5a53ed6e9c0c50b3466c62a2babb3f5ebfbd0273
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Jan 22 13:38:30 2020 +0800

    kwork/notifier: initialize the work handler
    
    kworker dqueue corruption if the garbage in work->worker handler
    
    Change-Id: Ice5e66e8ed080a7539d5fe02f946a66794cbda7d
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 sched/wqueue/kwork_notifier.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sched/wqueue/kwork_notifier.c b/sched/wqueue/kwork_notifier.c
index 0950dd4..0eff257 100644
--- a/sched/wqueue/kwork_notifier.c
+++ b/sched/wqueue/kwork_notifier.c
@@ -257,6 +257,10 @@ int work_notifier_setup(FAR struct work_notifier_s *info)
     }
   else
     {
+      /* Initialize the work structure */
+
+      memset(&notifier->work, 0, sizeof(notifier->work));
+
       /* Duplicate the notification info */
 
       memcpy(&notifier->info, info, sizeof(struct work_notifier_s));