Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90457
b: refs/heads/master
c: a2be75c
h: refs/heads/master
i:
  90455: 2da95f3
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Mar 29, 2008
1 parent 63597a8 commit 477e4e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dda61925f84d89e2f2a4597d6298a05a2bc05c20
refs/heads/master: a2be75c182cd16bc104919e33451ffda8b6f65b4
46 changes: 9 additions & 37 deletions trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,46 +1576,18 @@ static void udp_seq_stop(struct seq_file *seq, void *v)
static int udp_seq_open(struct inode *inode, struct file *file)
{
struct udp_seq_afinfo *afinfo = PDE(inode)->data;
struct seq_file *seq;
struct net *net;
int rc = -ENOMEM;
struct udp_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);

if (!s)
goto out;
struct udp_iter_state *s;
int err;

rc = -ENXIO;
net = get_proc_net(inode);
if (!net)
goto out_kfree;
err = seq_open_net(inode, file, &afinfo->seq_ops,
sizeof(struct udp_iter_state));
if (err < 0)
return err;

s = ((struct seq_file *)file->private_data)->private;
s->family = afinfo->family;
s->hashtable = afinfo->hashtable;
s->p.net = net;

rc = seq_open(file, &afinfo->seq_ops);
if (rc)
goto out_put_net;

seq = file->private_data;
seq->private = s;
out:
return rc;
out_put_net:
put_net(net);
out_kfree:
kfree(s);
goto out;
}

static int udp_seq_release(struct inode *inode, struct file *file)
{
struct seq_file *seq = file->private_data;
struct udp_iter_state *s = seq->private;

put_net(s->p.net);
seq_release_private(inode, file);
return 0;
return err;
}

/* ------------------------------------------------------------------------ */
Expand All @@ -1628,7 +1600,7 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
afinfo->seq_fops->open = udp_seq_open;
afinfo->seq_fops->read = seq_read;
afinfo->seq_fops->llseek = seq_lseek;
afinfo->seq_fops->release = udp_seq_release;
afinfo->seq_fops->release = seq_release_net;

afinfo->seq_ops.start = udp_seq_start;
afinfo->seq_ops.next = udp_seq_next;
Expand Down

0 comments on commit 477e4e1

Please sign in to comment.