Showing error 863

User: Jiri Slaby
Error type: Resource Leak
Error type description: The code omits to put the resource to the system for reuse
File location: kernel/spinlock.c
Line in file: 300
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

270/*
271 * Build preemption-friendly versions of the following
272 * lock-spinning functions:
273 *
274 *         _[spin|read|write]_lock()
275 *         _[spin|read|write]_lock_irq()
276 *         _[spin|read|write]_lock_irqsave()
277 *         _[spin|read|write]_lock_bh()
278 */
279BUILD_LOCK_OPS(spin, spinlock);
280BUILD_LOCK_OPS(read, rwlock);
281BUILD_LOCK_OPS(write, rwlock);
282
283#endif /* CONFIG_PREEMPT */
284
285#ifdef CONFIG_DEBUG_LOCK_ALLOC
286
287void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass)
288{
289        preempt_disable();
290        spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
291        LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
292}
293EXPORT_SYMBOL(_spin_lock_nested);
294
295unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
296{
297        unsigned long flags;
298
299        local_irq_save(flags);
300        preempt_disable();
301        spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
302        /*
303         * On lockdep we dont want the hand-coded irq-enable of
304         * _raw_spin_lock_flags() code, because lockdep assumes
305         * that interrupts are not re-enabled during lock-acquire:
306         */
307#ifdef CONFIG_LOCKDEP
308        LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
309#else
310        _raw_spin_lock_flags(lock, &flags);
Show full sources