Showing error 1501

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


Source:

 12#include <net/net_namespace.h>
 13#include <net/tcp_states.h>
 14#include <net/ipx.h>
 15
 16static __inline__ struct ipx_interface *ipx_get_interface_idx(loff_t pos)
 17{
 18        struct ipx_interface *i;
 19
 20        list_for_each_entry(i, &ipx_interfaces, node)
 21                if (!pos--)
 22                        goto out;
 23        i = NULL;
 24out:
 25        return i;
 26}
 27
 28static struct ipx_interface *ipx_interfaces_next(struct ipx_interface *i)
 29{
 30        struct ipx_interface *rc = NULL;
 31
 32        if (i->node.next != &ipx_interfaces)
 33                rc = list_entry(i->node.next, struct ipx_interface, node);
 34        return rc;
 35}
 36
 37static void *ipx_seq_interface_start(struct seq_file *seq, loff_t *pos)
 38{
 39        loff_t l = *pos;
 40
 41        spin_lock_bh(&ipx_interfaces_lock);
 42        return l ? ipx_get_interface_idx(--l) : SEQ_START_TOKEN;
 43}
 44
 45static void *ipx_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos)
 46{
 47        struct ipx_interface *i;
 48
 49        ++*pos;
 50        if (v == SEQ_START_TOKEN)
 51                i = ipx_interfaces_head();
 52        else
Show full sources