diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-07 23:51:39 -0800 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-03-20 14:08:55 -0500 |
commit | 4023e020807ea249ae83f0d1d851b4c7cf0afd8a (patch) | |
tree | 3bc91756c9429bd89c2ebb47108ed772dd29c4cf /kernel/auditsc.c | |
parent | d9d9ec6e2c45b22282cd36cf92fcb23d504350a8 (diff) | |
download | linux-4023e020807ea249ae83f0d1d851b4c7cf0afd8a.tar.gz linux-4023e020807ea249ae83f0d1d851b4c7cf0afd8a.tar.bz2 linux-4023e020807ea249ae83f0d1d851b4c7cf0afd8a.zip |
[PATCH] simplify audit_free() locking
Simplify audit_free()'s locking: no need to lock a task that we are tearing
down. [the extra locking also caused false positives in the lock
validator]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index d3d499272d13..b613ec89e99c 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -704,10 +704,14 @@ void audit_free(struct task_struct *tsk) { struct audit_context *context; - task_lock(tsk); + /* + * No need to lock the task - when we execute audit_free() + * then the task has no external references anymore, and + * we are tearing it down. (The locking also confuses + * DEBUG_LOCKDEP - this freeing may occur in softirq + * contexts as well, via RCU.) + */ context = audit_get_context(tsk, 0, 0); - task_unlock(tsk); - if (likely(!context)) return; |