Showing error 927

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: net/core/net_namespace.c
Line in file: 347
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Removed in f875bae065334907796da12523f9df85c89f5712
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

317 *        addition run the exit method for all existing network
318 *        namespaces.
319 */
320void unregister_pernet_subsys(struct pernet_operations *module)
321{
322        mutex_lock(&net_mutex);
323        unregister_pernet_operations(module);
324        mutex_unlock(&net_mutex);
325}
326EXPORT_SYMBOL_GPL(unregister_pernet_subsys);
327
328int register_pernet_gen_subsys(int *id, struct pernet_operations *ops)
329{
330        int rv;
331
332        mutex_lock(&net_mutex);
333again:
334        rv = ida_get_new_above(&net_generic_ids, 1, id);
335        if (rv < 0) {
336                if (rv == -EAGAIN) {
337                        ida_pre_get(&net_generic_ids, GFP_KERNEL);
338                        goto again;
339                }
340                goto out;
341        }
342        rv = register_pernet_operations(first_device, ops);
343        if (rv < 0)
344                ida_remove(&net_generic_ids, *id);
345        mutex_unlock(&net_mutex);
346out:
347        return rv;
348}
349EXPORT_SYMBOL_GPL(register_pernet_gen_subsys);
350
351void unregister_pernet_gen_subsys(int id, struct pernet_operations *ops)
352{
353        mutex_lock(&net_mutex);
354        unregister_pernet_operations(ops);
355        ida_remove(&net_generic_ids, id);
356        mutex_unlock(&net_mutex);
357}
Show full sources