summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-19 16:38:10 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-19 16:38:10 -0700
commit16ae527bfa03c6c82328098eafae972807ed32d4 (patch)
treecad921d7eeff11c9063a36204118ac8a66029c8f /kernel
parente23a5f66877d32f21a2ac15a200ad4a2b4c8b0ee (diff)
parent6793a051fb9311f0f1ab7eafc5a9e69b8a1bd8d4 (diff)
downloadop-kernel-dev-16ae527bfa03c6c82328098eafae972807ed32d4.zip
op-kernel-dev-16ae527bfa03c6c82328098eafae972807ed32d4.tar.gz
Merge branch 'audit.b51' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current
* 'audit.b51' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current: [PATCH] list_for_each_rcu must die: audit [patch 1/1] audit_send_reply(): fix error-path memory leak [PATCH] open sessionid permissions
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c11
-rw-r--r--kernel/audit_tree.c5
2 files changed, 8 insertions, 8 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index b7d3709..e8692a5 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -572,16 +572,17 @@ void audit_send_reply(int pid, int seq, int type, int done, int multi,
skb = audit_make_reply(pid, seq, type, done, multi, payload, size);
if (!skb)
- return;
+ goto out;
reply->pid = pid;
reply->skb = skb;
tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply");
- if (IS_ERR(tsk)) {
- kfree(reply);
- kfree_skb(skb);
- }
+ if (!IS_ERR(tsk))
+ return;
+ kfree_skb(skb);
+out:
+ kfree(reply);
}
/*
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index 9ef5e0a..f7921a2 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -172,10 +172,9 @@ static void insert_hash(struct audit_chunk *chunk)
struct audit_chunk *audit_tree_lookup(const struct inode *inode)
{
struct list_head *list = chunk_hash(inode);
- struct list_head *pos;
+ struct audit_chunk *p;
- list_for_each_rcu(pos, list) {
- struct audit_chunk *p = container_of(pos, struct audit_chunk, hash);
+ list_for_each_entry_rcu(p, list, hash) {
if (p->watch.inode == inode) {
get_inotify_watch(&p->watch);
return p;
OpenPOWER on IntegriCloud