Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67010
b: refs/heads/master
c: e2da591
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Oct 10, 2007
1 parent 831c7b6 commit 14b8499
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 110 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: cf7732e4cc14b56d593ff53352673e1fd5e3ba52
refs/heads/master: e2da59133880976586b2d9d81d798222ecafa566
15 changes: 2 additions & 13 deletions trunk/net/ipv4/netfilter/ipt_recent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
36 changes: 4 additions & 32 deletions trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,8 @@ static const struct seq_operations ct_seq_ops = {

static int ct_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
struct ct_iter_state *st;
int ret;

st = kzalloc(sizeof(struct ct_iter_state), GFP_KERNEL);
if (st == NULL)
return -ENOMEM;
ret = seq_open(file, &ct_seq_ops);
if (ret)
goto out_free;
seq = file->private_data;
seq->private = st;
return ret;
out_free:
kfree(st);
return ret;
return seq_open_private(file, &ct_seq_ops,
sizeof(struct ct_iter_state));
}

static const struct file_operations ct_file_ops = {
Expand Down Expand Up @@ -291,22 +277,8 @@ static const struct seq_operations exp_seq_ops = {

static int exp_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
struct ct_expect_iter_state *st;
int ret;

st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
if (!st)
return -ENOMEM;
ret = seq_open(file, &exp_seq_ops);
if (ret)
goto out_free;
seq = file->private_data;
seq->private = st;
return ret;
out_free:
kfree(st);
return ret;
return seq_open_private(file, &exp_seq_ops,
sizeof(struct ct_expect_iter_state));
}

static const struct file_operations ip_exp_file_ops = {
Expand Down
18 changes: 2 additions & 16 deletions trunk/net/netfilter/nf_conntrack_expect.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,22 +472,8 @@ static const struct seq_operations exp_seq_ops = {

static int exp_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
struct ct_expect_iter_state *st;
int ret;

st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
if (!st)
return -ENOMEM;
ret = seq_open(file, &exp_seq_ops);
if (ret)
goto out_free;
seq = file->private_data;
seq->private = st;
return ret;
out_free:
kfree(st);
return ret;
return seq_open_private(file, &exp_seq_ops,
sizeof(struct ct_expect_iter_state));
}

static const struct file_operations exp_file_ops = {
Expand Down
18 changes: 2 additions & 16 deletions trunk/net/netfilter/nf_conntrack_standalone.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,8 @@ static const struct seq_operations ct_seq_ops = {

static int ct_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
struct ct_iter_state *st;
int ret;

st = kzalloc(sizeof(struct ct_iter_state), GFP_KERNEL);
if (st == NULL)
return -ENOMEM;
ret = seq_open(file, &ct_seq_ops);
if (ret)
goto out_free;
seq = file->private_data;
seq->private = st;
return ret;
out_free:
kfree(st);
return ret;
return seq_open_private(file, &ct_seq_ops,
sizeof(struct ct_iter_state));
}

static const struct file_operations ct_file_ops = {
Expand Down
18 changes: 2 additions & 16 deletions trunk/net/netfilter/nfnetlink_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,22 +951,8 @@ static const struct seq_operations nful_seq_ops = {

static int nful_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
struct iter_state *is;
int ret;

is = kzalloc(sizeof(*is), GFP_KERNEL);
if (!is)
return -ENOMEM;
ret = seq_open(file, &nful_seq_ops);
if (ret < 0)
goto out_free;
seq = file->private_data;
seq->private = is;
return ret;
out_free:
kfree(is);
return ret;
return seq_open_private(file, &nful_seq_ops,
sizeof(struct iter_state));
}

static const struct file_operations nful_file_ops = {
Expand Down
18 changes: 2 additions & 16 deletions trunk/net/netfilter/nfnetlink_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,22 +1051,8 @@ static const struct seq_operations nfqnl_seq_ops = {

static int nfqnl_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
struct iter_state *is;
int ret;

is = kzalloc(sizeof(*is), GFP_KERNEL);
if (!is)
return -ENOMEM;
ret = seq_open(file, &nfqnl_seq_ops);
if (ret < 0)
goto out_free;
seq = file->private_data;
seq->private = is;
return ret;
out_free:
kfree(is);
return ret;
return seq_open_private(file, &nfqnl_seq_ops,
sizeof(struct iter_state));
}

static const struct file_operations nfqnl_file_ops = {
Expand Down

0 comments on commit 14b8499

Please sign in to comment.