]> err.no Git - linux-2.6/blobdiff - net/ipv4/fib_hash.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
[linux-2.6] / net / ipv4 / fib_hash.c
index 9fafbeea8fe64f4b4f5f219b7f814d8b13f82a2c..527a6e0af5b60eb48b9e15459e8877db10c29db8 100644 (file)
@@ -1039,24 +1039,8 @@ static const struct seq_operations fib_seq_ops = {
 
 static int fib_seq_open(struct inode *inode, struct file *file)
 {
-       struct seq_file *seq;
-       int rc = -ENOMEM;
-       struct fib_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
-
-       if (!s)
-               goto out;
-
-       rc = seq_open(file, &fib_seq_ops);
-       if (rc)
-               goto out_kfree;
-
-       seq          = file->private_data;
-       seq->private = s;
-out:
-       return rc;
-out_kfree:
-       kfree(s);
-       goto out;
+       return seq_open_private(file, &fib_seq_ops,
+                       sizeof(struct fib_iter_state));
 }
 
 static const struct file_operations fib_seq_fops = {