aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/taskstats_kern.h13
-rw-r--r--kernel/exit.c1
-rw-r--r--kernel/fork.c1
3 files changed, 3 insertions, 12 deletions
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
index 16894b7edcc8..a437ca0d226b 100644
--- a/include/linux/taskstats_kern.h
+++ b/include/linux/taskstats_kern.h
@@ -49,17 +49,8 @@ static inline void taskstats_tgid_alloc(struct signal_struct *sig)
49 49
50static inline void taskstats_tgid_free(struct signal_struct *sig) 50static inline void taskstats_tgid_free(struct signal_struct *sig)
51{ 51{
52 struct taskstats *stats = NULL; 52 if (sig->stats)
53 unsigned long flags; 53 kmem_cache_free(taskstats_cache, sig->stats);
54
55 spin_lock_irqsave(&sig->stats_lock, flags);
56 if (sig->stats) {
57 stats = sig->stats;
58 sig->stats = NULL;
59 }
60 spin_unlock_irqrestore(&sig->stats_lock, flags);
61 if (stats)
62 kmem_cache_free(taskstats_cache, stats);
63} 54}
64 55
65extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); 56extern void taskstats_exit_alloc(struct taskstats **, unsigned int *);
diff --git a/kernel/exit.c b/kernel/exit.c
index f250a5e3e281..06de6c4e8ca3 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -128,6 +128,7 @@ static void __exit_signal(struct task_struct *tsk)
128 flush_sigqueue(&tsk->pending); 128 flush_sigqueue(&tsk->pending);
129 if (sig) { 129 if (sig) {
130 flush_sigqueue(&sig->shared_pending); 130 flush_sigqueue(&sig->shared_pending);
131 taskstats_tgid_free(sig);
131 __cleanup_signal(sig); 132 __cleanup_signal(sig);
132 } 133 }
133} 134}
diff --git a/kernel/fork.c b/kernel/fork.c
index 29ebb30850ed..213326609bac 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -897,7 +897,6 @@ static inline int copy_signal(unsigned long clone_flags, struct task_struct * ts
897void __cleanup_signal(struct signal_struct *sig) 897void __cleanup_signal(struct signal_struct *sig)
898{ 898{
899 exit_thread_group_keys(sig); 899 exit_thread_group_keys(sig);
900 taskstats_tgid_free(sig);
901 kmem_cache_free(signal_cachep, sig); 900 kmem_cache_free(signal_cachep, sig);
902} 901}
903 902