Showing error 1428

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/user.c
Line in file: 316
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

286
287        /* Make uid_hash_remove() + sysfs_remove_file() + kobject_del()
288         * atomic.
289         */
290        uids_mutex_lock();
291
292        local_irq_save(flags);
293
294        if (atomic_dec_and_lock(&up->__count, &uidhash_lock)) {
295                uid_hash_remove(up);
296                remove_user = 1;
297                spin_unlock_irqrestore(&uidhash_lock, flags);
298        } else {
299                local_irq_restore(flags);
300        }
301
302        if (!remove_user)
303                goto done;
304
305        kobject_uevent(&up->kobj, KOBJ_REMOVE);
306        kobject_del(&up->kobj);
307        kobject_put(&up->kobj);
308
309        sched_destroy_user(up);
310        key_put(up->uid_keyring);
311        key_put(up->session_keyring);
312        kmem_cache_free(uid_cachep, up);
313
314done:
315        uids_mutex_unlock();
316}
317
318/* IRQs are disabled and uidhash_lock is held upon function entry.
319 * IRQ state (as stored in flags) is restored and uidhash_lock released
320 * upon function exit.
321 */
322static inline void free_user(struct user_struct *up, unsigned long flags)
323{
324        /* restore back the count */
325        atomic_inc(&up->__count);
326        spin_unlock_irqrestore(&uidhash_lock, flags);
Show full sources