]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv6/anycast.c
[NET]: Make core networking code use seq_open_private
[net-next-2.6.git] / net / ipv6 / anycast.c
index 5810852c558a7d48d44a4a74b04f0779a466e3a1..f915c4df9820085fb5a5ff5798c152f89e4f7f4d 100644 (file)
@@ -549,24 +549,8 @@ static const struct seq_operations ac6_seq_ops = {
 
 static int ac6_seq_open(struct inode *inode, struct file *file)
 {
-       struct seq_file *seq;
-       int rc = -ENOMEM;
-       struct ac6_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
-
-       if (!s)
-               goto out;
-
-       rc = seq_open(file, &ac6_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, &ac6_seq_ops,
+                       sizeof(struct ac6_iter_state));
 }
 
 static const struct file_operations ac6_seq_fops = {