Skip to contentSkip to conversation

kernel/acct.c: cleanup, also better to set related variable to NULL after kfree

PATCH New Chen Gang 1 participant 1 message May 13, 2013 4 messages not in the archive

lore
Share & tools
lore

Chen Gang

author
#4 lore raw

PATCH v2 1/1 kernel/acct.c: cleanup, also better to set related variable to NULL after kfree

In reply to a message not in the archive

After kfree acct, also better to set ns->bacct to NULL.

Currently, it is as a cleanup patch.

---
 kernel/acct.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
kernel/acct.c +1 -0
index 85389fe..91a23eb 100644
@@ -332,6 +332,7 @@ void acct_exit_ns(struct pid_namespace *ns)
 	spin_lock(&acct_lock);
 	if (acct->file != NULL)
 		acct_file_reopen(acct, NULL, NULL);
+	ns->bacct = NULL;
 	spin_unlock(&acct_lock);
 
 	kfree(acct);
Signature · 1 line
1.7.7.6