Showing error 1411

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: 967
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

 937 * __task_rq_lock - lock the runqueue a given task resides on.
 938 * Must be called interrupts disabled.
 939 */
 940static inline struct rq *__task_rq_lock(struct task_struct *p)
 941        __acquires(rq->lock)
 942{
 943        for (;;) {
 944                struct rq *rq = task_rq(p);
 945                spin_lock(&rq->lock);
 946                if (likely(rq == task_rq(p)))
 947                        return rq;
 948                spin_unlock(&rq->lock);
 949        }
 950}
 951
 952/*
 953 * task_rq_lock - lock the runqueue a given task resides on and disable
 954 * interrupts. Note the ordering: we can safely lookup the task_rq without
 955 * explicitly disabling preemption.
 956 */
 957static struct rq *task_rq_lock(struct task_struct *p, unsigned long *flags)
 958        __acquires(rq->lock)
 959{
 960        struct rq *rq;
 961
 962        for (;;) {
 963                local_irq_save(*flags);
 964                rq = task_rq(p);
 965                spin_lock(&rq->lock);
 966                if (likely(rq == task_rq(p)))
 967                        return rq;
 968                spin_unlock_irqrestore(&rq->lock, *flags);
 969        }
 970}
 971
 972void task_rq_unlock_wait(struct task_struct *p)
 973{
 974        struct rq *rq = task_rq(p);
 975
 976        smp_mb(); /* spin-unlock-wait is not a full memory barrier */
 977        spin_unlock_wait(&rq->lock);
Show full sources