Showing error 1081

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/cgroup.c
Line in file: 2517
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

2487        mutex_lock(&cgroup_mutex);
2488        parent = cgrp->parent;
2489        root = cgrp->root;
2490        sb = root->sb;
2491
2492        if (atomic_read(&cgrp->count)
2493            || !list_empty(&cgrp->children)
2494            || cgroup_has_css_refs(cgrp)) {
2495                mutex_unlock(&cgroup_mutex);
2496                return -EBUSY;
2497        }
2498
2499        spin_lock(&release_list_lock);
2500        set_bit(CGRP_REMOVED, &cgrp->flags);
2501        if (!list_empty(&cgrp->release_list))
2502                list_del(&cgrp->release_list);
2503        spin_unlock(&release_list_lock);
2504        /* delete my sibling from parent->children */
2505        list_del(&cgrp->sibling);
2506        spin_lock(&cgrp->dentry->d_lock);
2507        d = dget(cgrp->dentry);
2508        spin_unlock(&d->d_lock);
2509
2510        cgroup_d_remove_dir(d);
2511        dput(d);
2512
2513        set_bit(CGRP_RELEASABLE, &parent->flags);
2514        check_for_release(parent);
2515
2516        mutex_unlock(&cgroup_mutex);
2517        return 0;
2518}
2519
2520static void __init cgroup_init_subsys(struct cgroup_subsys *ss)
2521{
2522        struct cgroup_subsys_state *css;
2523
2524        printk(KERN_INFO "Initializing cgroup subsys %s\n", ss->name);
2525
2526        /* Create the top cgroup state for this subsystem */
2527        ss->root = &rootnode;
Show full sources