diff options
| -rw-r--r-- | fs/proc/task_nommu.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c index 678455d2d683..98c95d2833ea 100644 --- a/fs/proc/task_nommu.c +++ b/fs/proc/task_nommu.c | |||
| @@ -269,20 +269,13 @@ static int maps_open(struct inode *inode, struct file *file, | |||
| 269 | const struct seq_operations *ops) | 269 | const struct seq_operations *ops) |
| 270 | { | 270 | { |
| 271 | struct proc_maps_private *priv; | 271 | struct proc_maps_private *priv; |
| 272 | int ret = -ENOMEM; | 272 | |
| 273 | 273 | priv = __seq_open_private(file, ops, sizeof(struct proc_maps_private)); | |
| 274 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 274 | if (!priv) |
| 275 | if (priv) { | 275 | return -ENOMEM; |
| 276 | priv->pid = proc_pid(inode); | 276 | |
| 277 | ret = seq_open(file, ops); | 277 | priv->pid = proc_pid(inode); |
| 278 | if (!ret) { | 278 | return 0; |
| 279 | struct seq_file *m = file->private_data; | ||
| 280 | m->private = priv; | ||
| 281 | } else { | ||
| 282 | kfree(priv); | ||
| 283 | } | ||
| 284 | } | ||
| 285 | return ret; | ||
| 286 | } | 279 | } |
| 287 | 280 | ||
| 288 | static int pid_maps_open(struct inode *inode, struct file *file) | 281 | static int pid_maps_open(struct inode *inode, struct file *file) |
