aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/netfilter/ipt_recent.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2007-10-10 02:29:58 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:55:34 -0700
commite2da59133880976586b2d9d81d798222ecafa566 (patch)
tree03cb1c61318992437e3bc040b34fa437b957c662 /net/ipv4/netfilter/ipt_recent.c
parent[NET]: Make core networking code use seq_open_private (diff)
downloadlinux-dev-e2da59133880976586b2d9d81d798222ecafa566.tar.xz
linux-dev-e2da59133880976586b2d9d81d798222ecafa566.zip
[NETFILTER]: Make netfilter code use the seq_open_private
Just switch to the consolidated calls. ipt_recent() has to initialize the private, so use the __seq_open_private() helper. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/netfilter/ipt_recent.c')
-rw-r--r--net/ipv4/netfilter/ipt_recent.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c
index db2a79889f9a..11d39fb5f38b 100644
--- a/net/ipv4/netfilter/ipt_recent.c
+++ b/net/ipv4/netfilter/ipt_recent.c
@@ -381,25 +381,14 @@ static const struct seq_operations recent_seq_ops = {
static int recent_seq_open(struct inode *inode, struct file *file)
{
struct proc_dir_entry *pde = PDE(inode);
- struct seq_file *seq;
struct recent_iter_state *st;
- int ret;
- st = kzalloc(sizeof(*st), GFP_KERNEL);
+ st = __seq_open_private(file, &recent_seq_ops, sizeof(*st));
if (st == NULL)
return -ENOMEM;
- ret = seq_open(file, &recent_seq_ops);
- if (ret) {
- kfree(st);
- goto out;
- }
-
st->table = pde->data;
- seq = file->private_data;
- seq->private = st;
-out:
- return ret;
+ return 0;
}
static ssize_t recent_proc_write(struct file *file, const char __user *input,