]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv6/raw.c
[NET]: Make core networking code use seq_open_private
[net-next-2.6.git] / net / ipv6 / raw.c
index bdd0974e6775c6e0542369d9310a5cb10be4af2a..ca24ef19cd8f294c35d7d285751a5bb55c5d1838 100644 (file)
@@ -1289,21 +1289,8 @@ static const struct seq_operations raw6_seq_ops = {
 
 static int raw6_seq_open(struct inode *inode, struct file *file)
 {
-       struct seq_file *seq;
-       int rc = -ENOMEM;
-       struct raw6_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
-       if (!s)
-               goto out;
-       rc = seq_open(file, &raw6_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, &raw6_seq_ops,
+                       sizeof(struct raw6_iter_state));
 }
 
 static const struct file_operations raw6_seq_fops = {