Showing error 1045

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: kernel/audit_tree.c
Line in file: 319
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

289                if (!s) /* result of earlier fallback */
290                        continue;
291                get_tree(s);
292                list_replace_init(&chunk->owners[i].list, &new->owners[j].list);
293        }
294
295        list_replace_rcu(&chunk->hash, &new->hash);
296        list_for_each_entry(owner, &new->trees, same_root)
297                owner->root = new;
298        spin_unlock(&hash_lock);
299        inotify_evict_watch(&chunk->watch);
300        mutex_unlock(&chunk->watch.inode->inotify_mutex);
301        put_inotify_watch(&chunk->watch);
302        goto out;
303
304Fallback:
305        // do the best we can
306        spin_lock(&hash_lock);
307        if (owner->root == chunk) {
308                list_del_init(&owner->same_root);
309                owner->root = NULL;
310        }
311        list_del_init(&p->list);
312        p->owner = NULL;
313        put_tree(owner);
314        spin_unlock(&hash_lock);
315        mutex_unlock(&chunk->watch.inode->inotify_mutex);
316out:
317        unpin_inotify_watch(&chunk->watch);
318        spin_lock(&hash_lock);
319}
320
321static int create_chunk(struct inode *inode, struct audit_tree *tree)
322{
323        struct audit_chunk *chunk = alloc_chunk(1);
324        if (!chunk)
325                return -ENOMEM;
326
327        if (inotify_add_watch(rtree_ih, &chunk->watch, inode, IN_IGNORED | IN_DELETE_SELF) < 0) {
328                free_chunk(chunk);
329                return -ENOSPC;
Show full sources