diff options
Diffstat (limited to 'net/wireless/wext.c')
-rw-r--r-- | net/wireless/wext.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/net/wireless/wext.c b/net/wireless/wext.c index db03ed5ce055..1e4cf615f878 100644 --- a/net/wireless/wext.c +++ b/net/wireless/wext.c | |||
@@ -673,26 +673,8 @@ static const struct seq_operations wireless_seq_ops = { | |||
673 | 673 | ||
674 | static int wireless_seq_open(struct inode *inode, struct file *file) | 674 | static int wireless_seq_open(struct inode *inode, struct file *file) |
675 | { | 675 | { |
676 | struct seq_file *seq; | 676 | return seq_open_net(inode, file, &wireless_seq_ops, |
677 | int res; | 677 | sizeof(struct seq_net_private)); |
678 | res = seq_open(file, &wireless_seq_ops); | ||
679 | if (!res) { | ||
680 | seq = file->private_data; | ||
681 | seq->private = get_proc_net(inode); | ||
682 | if (!seq->private) { | ||
683 | seq_release(inode, file); | ||
684 | res = -ENXIO; | ||
685 | } | ||
686 | } | ||
687 | return res; | ||
688 | } | ||
689 | |||
690 | static int wireless_seq_release(struct inode *inode, struct file *file) | ||
691 | { | ||
692 | struct seq_file *seq = file->private_data; | ||
693 | struct net *net = seq->private; | ||
694 | put_net(net); | ||
695 | return seq_release(inode, file); | ||
696 | } | 678 | } |
697 | 679 | ||
698 | static const struct file_operations wireless_seq_fops = { | 680 | static const struct file_operations wireless_seq_fops = { |
@@ -700,7 +682,7 @@ static const struct file_operations wireless_seq_fops = { | |||
700 | .open = wireless_seq_open, | 682 | .open = wireless_seq_open, |
701 | .read = seq_read, | 683 | .read = seq_read, |
702 | .llseek = seq_lseek, | 684 | .llseek = seq_lseek, |
703 | .release = wireless_seq_release, | 685 | .release = seq_release_net, |
704 | }; | 686 | }; |
705 | 687 | ||
706 | int wext_proc_init(struct net *net) | 688 | int wext_proc_init(struct net *net) |