Showing error 1596

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: 5154
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-29 20:11:37 UTC


Source:

5124        case SCHED_FIFO:
5125        case SCHED_RR:
5126                p->sched_class = &rt_sched_class;
5127                break;
5128        }
5129
5130        p->rt_priority = prio;
5131        p->normal_prio = normal_prio(p);
5132        /* we are holding p->pi_lock already */
5133        p->prio = rt_mutex_getprio(p);
5134        set_load_weight(p);
5135}
5136
5137static int __sched_setscheduler(struct task_struct *p, int policy,
5138                                struct sched_param *param, bool user)
5139{
5140        int retval, oldprio, oldpolicy = -1, on_rq, running;
5141        unsigned long flags;
5142        const struct sched_class *prev_class = p->sched_class;
5143        struct rq *rq;
5144
5145        /* may grab non-irq protected spin_locks */
5146        BUG_ON(in_interrupt());
5147recheck:
5148        /* double check policy once rq lock held */
5149        if (policy < 0)
5150                policy = oldpolicy = p->policy;
5151        else if (policy != SCHED_FIFO && policy != SCHED_RR &&
5152                        policy != SCHED_NORMAL && policy != SCHED_BATCH &&
5153                        policy != SCHED_IDLE)
5154                return -EINVAL;
5155        /*
5156         * Valid priorities for SCHED_FIFO and SCHED_RR are
5157         * 1..MAX_USER_RT_PRIO-1, valid priority for SCHED_NORMAL,
5158         * SCHED_BATCH and SCHED_IDLE is 0.
5159         */
5160        if (param->sched_priority < 0 ||
5161            (p->mm && param->sched_priority > MAX_USER_RT_PRIO-1) ||
5162            (!p->mm && param->sched_priority > MAX_RT_PRIO-1))
5163                return -EINVAL;
5164        if (rt_policy(policy) != (param->sched_priority != 0))
Show full sources