From 902138feead179bf1e8a2bd7a2e276e4015529d5 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 19 Dec 2009 16:03:30 +0000 Subject: [PATCH] --- yaml --- r: 177995 b: refs/heads/master c: b4c30aad39805902cf5b855aa8a8b22d728ad057 h: refs/heads/master i: 177993: 4011817fa9223ec184d568352237e29d51036c39 177991: 06e41c5bc650e0dcde82387ca3a9fc7d8fe358d9 v: v3 --- [refs] | 2 +- trunk/kernel/audit_tree.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index fd48bae1713c..9fffb855857b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6f5d51148921c242680a7a1d9913384a30ab3cbe +refs/heads/master: b4c30aad39805902cf5b855aa8a8b22d728ad057 diff --git a/trunk/kernel/audit_tree.c b/trunk/kernel/audit_tree.c index b36aa9651ba2..4b05bd9479db 100644 --- a/trunk/kernel/audit_tree.c +++ b/trunk/kernel/audit_tree.c @@ -373,15 +373,17 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) for (n = 0; n < old->count; n++) { if (old->owners[n].owner == tree) { spin_unlock(&hash_lock); - put_inotify_watch(watch); + put_inotify_watch(&old->watch); return 0; } } spin_unlock(&hash_lock); chunk = alloc_chunk(old->count + 1); - if (!chunk) + if (!chunk) { + put_inotify_watch(&old->watch); return -ENOMEM; + } mutex_lock(&inode->inotify_mutex); if (inotify_clone_watch(&old->watch, &chunk->watch) < 0) { @@ -425,7 +427,8 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) spin_unlock(&hash_lock); inotify_evict_watch(&old->watch); mutex_unlock(&inode->inotify_mutex); - put_inotify_watch(&old->watch); + put_inotify_watch(&old->watch); /* pair to inotify_find_watch */ + put_inotify_watch(&old->watch); /* and kill it */ return 0; }