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: | 5618 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Stanse
(1.2)
|
Entered: | 2012-05-21 20:30:05 UTC |
5588 system_state == SYSTEM_RUNNING) { 5589 __cond_resched(); 5590 return 1; 5591 } 5592 return 0; 5593} 5594EXPORT_SYMBOL(_cond_resched); 5595 5596/* 5597 * cond_resched_lock() - if a reschedule is pending, drop the given lock, 5598 * call schedule, and on return reacquire the lock. 5599 * 5600 * This works OK both with and without CONFIG_PREEMPT. We do strange low-level 5601 * operations here to prevent schedule() from being called twice (once via 5602 * spin_unlock(), once by hand). 5603 */ 5604int cond_resched_lock(spinlock_t *lock) 5605{ 5606 int resched = need_resched() && system_state == SYSTEM_RUNNING; 5607 int ret = 0; 5608 5609 if (spin_needbreak(lock) || resched) { 5610 spin_unlock(lock); 5611 if (resched && need_resched()) 5612 __cond_resched(); 5613 else 5614 cpu_relax(); 5615 ret = 1; 5616 spin_lock(lock); 5617 } 5618 return ret; 5619} 5620EXPORT_SYMBOL(cond_resched_lock); 5621 5622int __sched cond_resched_softirq(void) 5623{ 5624 BUG_ON(!in_softirq()); 5625 5626 if (need_resched() && system_state == SYSTEM_RUNNING) { 5627 local_bh_enable(); 5628 __cond_resched();