diff options
Diffstat (limited to 'net/atm/lec.c')
-rw-r--r-- | net/atm/lec.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c index 0e450d12f035..e2d800d818e3 100644 --- a/net/atm/lec.c +++ b/net/atm/lec.c | |||
@@ -1169,32 +1169,7 @@ static const struct seq_operations lec_seq_ops = { | |||
1169 | 1169 | ||
1170 | static int lec_seq_open(struct inode *inode, struct file *file) | 1170 | static int lec_seq_open(struct inode *inode, struct file *file) |
1171 | { | 1171 | { |
1172 | struct lec_state *state; | 1172 | return seq_open_private(file, &lec_seq_ops, sizeof(struct lec_state)); |
1173 | struct seq_file *seq; | ||
1174 | int rc = -EAGAIN; | ||
1175 | |||
1176 | state = kmalloc(sizeof(*state), GFP_KERNEL); | ||
1177 | if (!state) { | ||
1178 | rc = -ENOMEM; | ||
1179 | goto out; | ||
1180 | } | ||
1181 | |||
1182 | rc = seq_open(file, &lec_seq_ops); | ||
1183 | if (rc) | ||
1184 | goto out_kfree; | ||
1185 | seq = file->private_data; | ||
1186 | seq->private = state; | ||
1187 | out: | ||
1188 | return rc; | ||
1189 | |||
1190 | out_kfree: | ||
1191 | kfree(state); | ||
1192 | goto out; | ||
1193 | } | ||
1194 | |||
1195 | static int lec_seq_release(struct inode *inode, struct file *file) | ||
1196 | { | ||
1197 | return seq_release_private(inode, file); | ||
1198 | } | 1173 | } |
1199 | 1174 | ||
1200 | static const struct file_operations lec_seq_fops = { | 1175 | static const struct file_operations lec_seq_fops = { |
@@ -1202,7 +1177,7 @@ static const struct file_operations lec_seq_fops = { | |||
1202 | .open = lec_seq_open, | 1177 | .open = lec_seq_open, |
1203 | .read = seq_read, | 1178 | .read = seq_read, |
1204 | .llseek = seq_lseek, | 1179 | .llseek = seq_lseek, |
1205 | .release = lec_seq_release, | 1180 | .release = seq_release_private, |
1206 | }; | 1181 | }; |
1207 | #endif | 1182 | #endif |
1208 | 1183 | ||