lkml.org 
[lkml]   [2013]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] task_work: check callback if it's NULL
Date
Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
---
kernel/task_work.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/task_work.c b/kernel/task_work.c
index 0bf4258..f458b08 100644
--- a/kernel/task_work.c
+++ b/kernel/task_work.c
@@ -75,7 +75,8 @@ void task_work_run(void)

do {
next = work->next;
- work->func(work);
+ if (unlikely(work->func))
+ work->func(work);
work = next;
cond_resched();
} while (work);
--
1.7.2.5


\
 
 \ /
  Last update: 2013-03-14 09:41    [W:0.273 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site