diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 0aff28cdbadd..12cdd9fc9d02 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -803,6 +803,16 @@ static inline int copy_sighand(unsigned long clone_flags, struct task_struct * t | |||
803 | return 0; | 803 | return 0; |
804 | } | 804 | } |
805 | 805 | ||
806 | void cleanup_sighand(struct task_struct *tsk) | ||
807 | { | ||
808 | struct sighand_struct * sighand = tsk->sighand; | ||
809 | |||
810 | /* Ok, we're done with the signal handlers */ | ||
811 | tsk->sighand = NULL; | ||
812 | if (atomic_dec_and_test(&sighand->count)) | ||
813 | kmem_cache_free(sighand_cachep, sighand); | ||
814 | } | ||
815 | |||
806 | static inline int copy_signal(unsigned long clone_flags, struct task_struct * tsk) | 816 | static inline int copy_signal(unsigned long clone_flags, struct task_struct * tsk) |
807 | { | 817 | { |
808 | struct signal_struct *sig; | 818 | struct signal_struct *sig; |
@@ -1224,7 +1234,7 @@ bad_fork_cleanup_mm: | |||
1224 | bad_fork_cleanup_signal: | 1234 | bad_fork_cleanup_signal: |
1225 | cleanup_signal(p); | 1235 | cleanup_signal(p); |
1226 | bad_fork_cleanup_sighand: | 1236 | bad_fork_cleanup_sighand: |
1227 | __exit_sighand(p); | 1237 | cleanup_sighand(p); |
1228 | bad_fork_cleanup_fs: | 1238 | bad_fork_cleanup_fs: |
1229 | exit_fs(p); /* blocking */ | 1239 | exit_fs(p); /* blocking */ |
1230 | bad_fork_cleanup_files: | 1240 | bad_fork_cleanup_files: |