Showing error 1387

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


Source:

2261        int node;                        /* node that zone z is on */
2262
2263        if (in_interrupt() || (gfp_mask & __GFP_THISNODE))
2264                return 1;
2265        node = zone_to_nid(z);
2266        if (node_isset(node, current->mems_allowed))
2267                return 1;
2268        /*
2269         * Allow tasks that have access to memory reserves because they have
2270         * been OOM killed to get memory anywhere.
2271         */
2272        if (unlikely(test_thread_flag(TIF_MEMDIE)))
2273                return 1;
2274        return 0;
2275}
2276
2277/**
2278 * cpuset_lock - lock out any changes to cpuset structures
2279 *
2280 * The out of memory (oom) code needs to mutex_lock cpusets
2281 * from being changed while it scans the tasklist looking for a
2282 * task in an overlapping cpuset.  Expose callback_mutex via this
2283 * cpuset_lock() routine, so the oom code can lock it, before
2284 * locking the task list.  The tasklist_lock is a spinlock, so
2285 * must be taken inside callback_mutex.
2286 */
2287
2288void cpuset_lock(void)
2289{
2290        mutex_lock(&callback_mutex);
2291}
2292
2293/**
2294 * cpuset_unlock - release lock on cpuset changes
2295 *
2296 * Undo the lock taken in a previous cpuset_lock() call.
2297 */
2298
2299void cpuset_unlock(void)
2300{
2301        mutex_unlock(&callback_mutex);
Show full sources