Showing error 1603

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


Source:

5749        retval = -ESRCH;
5750        read_lock(&tasklist_lock);
5751        p = find_process_by_pid(pid);
5752        if (!p)
5753                goto out_unlock;
5754
5755        retval = security_task_getscheduler(p);
5756        if (retval)
5757                goto out_unlock;
5758
5759        /*
5760         * Time slice is 0 for SCHED_FIFO tasks and for SCHED_OTHER
5761         * tasks that are on an otherwise idle runqueue:
5762         */
5763        time_slice = 0;
5764        if (p->policy == SCHED_RR) {
5765                time_slice = DEF_TIMESLICE;
5766        } else if (p->policy != SCHED_FIFO) {
5767                struct sched_entity *se = &p->se;
5768                unsigned long flags;
5769                struct rq *rq;
5770
5771                rq = task_rq_lock(p, &flags);
5772                if (rq->cfs.load.weight)
5773                        time_slice = NS_TO_JIFFIES(sched_slice(&rq->cfs, se));
5774                task_rq_unlock(rq, &flags);
5775        }
5776        read_unlock(&tasklist_lock);
5777        jiffies_to_timespec(time_slice, &t);
5778        retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0;
5779        return retval;
5780
5781out_unlock:
5782        read_unlock(&tasklist_lock);
5783        return retval;
5784}
5785
5786static const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
5787
5788void sched_show_task(struct task_struct *p)
5789{
Show full sources