Showing error 1594

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/sched.c
Line in file: 5457
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-29 20:11:37 UTC


Source:

5427
5428        retval = -EPERM;
5429        if ((current->euid != p->euid) && (current->euid != p->uid) &&
5430                        !capable(CAP_SYS_NICE))
5431                goto out_unlock;
5432
5433        retval = security_task_setscheduler(p, 0, NULL);
5434        if (retval)
5435                goto out_unlock;
5436
5437        cpuset_cpus_allowed(p, &cpus_allowed);
5438        cpus_and(new_mask, new_mask, cpus_allowed);
5439 again:
5440        retval = set_cpus_allowed_ptr(p, &new_mask);
5441
5442        if (!retval) {
5443                cpuset_cpus_allowed(p, &cpus_allowed);
5444                if (!cpus_subset(new_mask, cpus_allowed)) {
5445                        /*
5446                         * We must have raced with a concurrent cpuset
5447                         * update. Just reset the cpus_allowed to the
5448                         * cpuset's cpus_allowed
5449                         */
5450                        new_mask = cpus_allowed;
5451                        goto again;
5452                }
5453        }
5454out_unlock:
5455        put_task_struct(p);
5456        put_online_cpus();
5457        return retval;
5458}
5459
5460static int get_user_cpu_mask(unsigned long __user *user_mask_ptr, unsigned len,
5461                             cpumask_t *new_mask)
5462{
5463        if (len < sizeof(cpumask_t)) {
5464                memset(new_mask, 0, sizeof(cpumask_t));
5465        } else if (len > sizeof(cpumask_t)) {
5466                len = sizeof(cpumask_t);
5467        }
Show full sources