Showing error 1530

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


Source:

 798};
 799
 800static int xt_table_open(struct inode *inode, struct file *file)
 801{
 802        int ret;
 803        struct xt_names_priv *priv;
 804
 805        ret = seq_open_net(inode, file, &xt_table_seq_ops,
 806                           sizeof(struct xt_names_priv));
 807        if (!ret) {
 808                priv = ((struct seq_file *)file->private_data)->private;
 809                priv->af = (unsigned long)PDE(inode)->data;
 810        }
 811        return ret;
 812}
 813
 814static const struct file_operations xt_table_ops = {
 815        .owner         = THIS_MODULE,
 816        .open         = xt_table_open,
 817        .read         = seq_read,
 818        .llseek         = seq_lseek,
 819        .release = seq_release_net,
 820};
 821
 822static void *xt_match_seq_start(struct seq_file *seq, loff_t *pos)
 823{
 824        struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
 825        u_int16_t af = (unsigned long)pde->data;
 826
 827        mutex_lock(&xt[af].mutex);
 828        return seq_list_start(&xt[af].match, *pos);
 829}
 830
 831static void *xt_match_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 832{
 833        struct proc_dir_entry *pde = (struct proc_dir_entry *)seq->private;
 834        u_int16_t af = (unsigned long)pde->data;
 835
 836        return seq_list_next(v, &xt[af].match, pos);
 837}
 838
Show full sources