aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index cc8d4e2a9531..331d728c2035 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2426,24 +2426,8 @@ static const struct seq_operations igmp6_mc_seq_ops = {
2426 2426
2427static int igmp6_mc_seq_open(struct inode *inode, struct file *file) 2427static int igmp6_mc_seq_open(struct inode *inode, struct file *file)
2428{ 2428{
2429 struct seq_file *seq; 2429 return seq_open_private(file, &igmp6_mc_seq_ops,
2430 int rc = -ENOMEM; 2430 sizeof(struct igmp6_mc_iter_state));
2431 struct igmp6_mc_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
2432
2433 if (!s)
2434 goto out;
2435
2436 rc = seq_open(file, &igmp6_mc_seq_ops);
2437 if (rc)
2438 goto out_kfree;
2439
2440 seq = file->private_data;
2441 seq->private = s;
2442out:
2443 return rc;
2444out_kfree:
2445 kfree(s);
2446 goto out;
2447} 2431}
2448 2432
2449static const struct file_operations igmp6_mc_seq_fops = { 2433static const struct file_operations igmp6_mc_seq_fops = {
@@ -2600,24 +2584,8 @@ static const struct seq_operations igmp6_mcf_seq_ops = {
2600 2584
2601static int igmp6_mcf_seq_open(struct inode *inode, struct file *file) 2585static int igmp6_mcf_seq_open(struct inode *inode, struct file *file)
2602{ 2586{
2603 struct seq_file *seq; 2587 return seq_open_private(file, &igmp6_mcf_seq_ops,
2604 int rc = -ENOMEM; 2588 sizeof(struct igmp6_mcf_iter_state));
2605 struct igmp6_mcf_iter_state *s = kzalloc(sizeof(*s), GFP_KERNEL);
2606
2607 if (!s)
2608 goto out;
2609
2610 rc = seq_open(file, &igmp6_mcf_seq_ops);
2611 if (rc)
2612 goto out_kfree;
2613
2614 seq = file->private_data;
2615 seq->private = s;
2616out:
2617 return rc;
2618out_kfree:
2619 kfree(s);
2620 goto out;
2621} 2589}
2622 2590
2623static const struct file_operations igmp6_mcf_seq_fops = { 2591static const struct file_operations igmp6_mcf_seq_fops = {