diff options
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/af_unix.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 10e73122c34c..2b57eaf66abc 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -2086,25 +2086,7 @@ static const struct seq_operations unix_seq_ops = { | |||
2086 | 2086 | ||
2087 | static int unix_seq_open(struct inode *inode, struct file *file) | 2087 | static int unix_seq_open(struct inode *inode, struct file *file) |
2088 | { | 2088 | { |
2089 | struct seq_file *seq; | 2089 | return seq_open_private(file, &unix_seq_ops, sizeof(int)); |
2090 | int rc = -ENOMEM; | ||
2091 | int *iter = kmalloc(sizeof(int), GFP_KERNEL); | ||
2092 | |||
2093 | if (!iter) | ||
2094 | goto out; | ||
2095 | |||
2096 | rc = seq_open(file, &unix_seq_ops); | ||
2097 | if (rc) | ||
2098 | goto out_kfree; | ||
2099 | |||
2100 | seq = file->private_data; | ||
2101 | seq->private = iter; | ||
2102 | *iter = 0; | ||
2103 | out: | ||
2104 | return rc; | ||
2105 | out_kfree: | ||
2106 | kfree(iter); | ||
2107 | goto out; | ||
2108 | } | 2090 | } |
2109 | 2091 | ||
2110 | static const struct file_operations unix_seq_fops = { | 2092 | static const struct file_operations unix_seq_fops = { |