diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2014-03-23 10:20:44 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2014-03-25 12:33:42 -0400 |
| commit | ea2e64f280d2a34a8ed9ae3d783cd770d14b70ec (patch) | |
| tree | 49bbf487a2b6683f73d9970ba97598ba1a9da30d /include | |
| parent | 87291a9267ecc0a8efceb4d9cbd4da870f958fc1 (diff) | |
workqueue: Provide destroy_delayed_work_on_stack()
If a delayed or deferrable work is on stack we need to tell debug
objects that we are destroying the timer and the work. Otherwise we
leak the tracking object.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Acked-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/20140323141939.911487677@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/workqueue.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 594521ba0d43..abdbe5af119d 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -191,6 +191,7 @@ struct execute_work { | |||
| 191 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | 191 | #ifdef CONFIG_DEBUG_OBJECTS_WORK |
| 192 | extern void __init_work(struct work_struct *work, int onstack); | 192 | extern void __init_work(struct work_struct *work, int onstack); |
| 193 | extern void destroy_work_on_stack(struct work_struct *work); | 193 | extern void destroy_work_on_stack(struct work_struct *work); |
| 194 | extern void destroy_delayed_work_on_stack(struct delayed_work *work); | ||
| 194 | static inline unsigned int work_static(struct work_struct *work) | 195 | static inline unsigned int work_static(struct work_struct *work) |
| 195 | { | 196 | { |
| 196 | return *work_data_bits(work) & WORK_STRUCT_STATIC; | 197 | return *work_data_bits(work) & WORK_STRUCT_STATIC; |
| @@ -198,6 +199,7 @@ static inline unsigned int work_static(struct work_struct *work) | |||
| 198 | #else | 199 | #else |
| 199 | static inline void __init_work(struct work_struct *work, int onstack) { } | 200 | static inline void __init_work(struct work_struct *work, int onstack) { } |
| 200 | static inline void destroy_work_on_stack(struct work_struct *work) { } | 201 | static inline void destroy_work_on_stack(struct work_struct *work) { } |
| 202 | static inline void destroy_delayed_work_on_stack(struct delayed_work *work) { } | ||
| 201 | static inline unsigned int work_static(struct work_struct *work) { return 0; } | 203 | static inline unsigned int work_static(struct work_struct *work) { return 0; } |
| 202 | #endif | 204 | #endif |
| 203 | 205 | ||
