mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
[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 <[email protected]> Cc: David Woodhouse <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
1 parent
d9d9ec6e2c
commit
4023e02080
1 file changed
+7
-3
+7
-3
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user