diff options
-rw-r--r-- | include/linux/delayacct.h | 4 | ||||
-rw-r--r-- | kernel/taskstats.c | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 7e8b6011b8f3..8a284cc6fd5f 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h | |||
@@ -80,9 +80,7 @@ static inline void delayacct_blkio_end(void) | |||
80 | static inline int delayacct_add_tsk(struct taskstats *d, | 80 | static inline int delayacct_add_tsk(struct taskstats *d, |
81 | struct task_struct *tsk) | 81 | struct task_struct *tsk) |
82 | { | 82 | { |
83 | if (likely(!delayacct_on)) | 83 | if (likely(!delayacct_on) || !tsk->delays) |
84 | return -EINVAL; | ||
85 | if (!tsk->delays) | ||
86 | return 0; | 84 | return 0; |
87 | return __delayacct_add_tsk(d, tsk); | 85 | return __delayacct_add_tsk(d, tsk); |
88 | } | 86 | } |
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index f45179ce028e..b4c737a11408 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -177,7 +177,7 @@ static int send_cpu_listeners(struct sk_buff *skb, unsigned int cpu) | |||
177 | static int fill_pid(pid_t pid, struct task_struct *pidtsk, | 177 | static int fill_pid(pid_t pid, struct task_struct *pidtsk, |
178 | struct taskstats *stats) | 178 | struct taskstats *stats) |
179 | { | 179 | { |
180 | int rc; | 180 | int rc = 0; |
181 | struct task_struct *tsk = pidtsk; | 181 | struct task_struct *tsk = pidtsk; |
182 | 182 | ||
183 | if (!pidtsk) { | 183 | if (!pidtsk) { |
@@ -196,12 +196,10 @@ static int fill_pid(pid_t pid, struct task_struct *pidtsk, | |||
196 | * Each accounting subsystem adds calls to its functions to | 196 | * Each accounting subsystem adds calls to its functions to |
197 | * fill in relevant parts of struct taskstsats as follows | 197 | * fill in relevant parts of struct taskstsats as follows |
198 | * | 198 | * |
199 | * rc = per-task-foo(stats, tsk); | 199 | * per-task-foo(stats, tsk); |
200 | * if (rc) | ||
201 | * goto err; | ||
202 | */ | 200 | */ |
203 | 201 | ||
204 | rc = delayacct_add_tsk(stats, tsk); | 202 | delayacct_add_tsk(stats, tsk); |
205 | stats->version = TASKSTATS_VERSION; | 203 | stats->version = TASKSTATS_VERSION; |
206 | 204 | ||
207 | /* Define err: label here if needed */ | 205 | /* Define err: label here if needed */ |