From 5a53ed6e9c0c50b3466c62a2babb3f5ebfbd0273 Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Wed, 22 Jan 2020 13:38:30 +0800 Subject: [PATCH] kwork/notifier: initialize the work handler kworker dqueue corruption if the garbage in work->worker handler Change-Id: Ice5e66e8ed080a7539d5fe02f946a66794cbda7d Signed-off-by: chao.an --- 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 0950dd4886d..0eff25713f3 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(¬ifier->work, 0, sizeof(notifier->work)); + /* Duplicate the notification info */ memcpy(¬ifier->info, info, sizeof(struct work_notifier_s));