aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/fib_hash.c')
-rw-r--r--net/ipv4/fib_hash.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c
index 9fafbeea8fe6..527a6e0af5b6 100644
--- a/net/ipv4/fib_hash.c
+++ b/net/ipv4/fib_hash.c
@@ -1039,24 +1039,8 @@ static const struct seq_operations fib_seq_ops = {
1039 1039
1040static int fib_seq_open(struct inode *inode, struct file *file) 1040static int fib_seq_open(struct inode *inode, struct file *file)
1041{ 1041{
1042 struct seq_file *seq; 1042 return seq_open_private(file, &fib_seq_ops,
1043 int rc = -ENOMEM; 1043 sizeof(struct fib_iter_state));
1044 struct fib_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
1045
1046 if (!s)
1047 goto out;
1048
1049 rc = seq_open(file, &fib_seq_ops);
1050 if (rc)
1051 goto out_kfree;
1052
1053 seq = file->private_data;
1054 seq->private = s;
1055out:
1056 return rc;
1057out_kfree:
1058 kfree(s);
1059 goto out;
1060} 1044}
1061 1045
1062static const struct file_operations fib_seq_fops = { 1046static const struct file_operations fib_seq_fops = {