summaryrefslogtreecommitdiff
path: root/fs/proc/task_mmu.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-02-16 06:22:54 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-23 23:36:50 +0300
commitec6fd8a4355cda81cd9f06bebc048e83eb514ac7 (patch)
tree828c3f2e1b474cc0ec9768d5dc19cfa2c086898f /fs/proc/task_mmu.c
parentca6b0bf0e086513b9ee5efc0aa5770ecb57778af (diff)
downloadlinux-ec6fd8a4355cda81cd9f06bebc048e83eb514ac7.tar.xz
report errors in /proc/*/*map* sanely
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/task_mmu.c')
-rw-r--r--fs/proc/task_mmu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index c966413c139b..8fed0f88fbf7 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -119,11 +119,11 @@ static void *m_start(struct seq_file *m, loff_t *pos)
priv->task = get_pid_task(priv->pid, PIDTYPE_PID);
if (!priv->task)
- return NULL;
+ return ERR_PTR(-ESRCH);
mm = mm_for_maps(priv->task);
- if (!mm)
- return NULL;
+ if (!mm || IS_ERR(mm))
+ return mm;
down_read(&mm->mmap_sem);
tail_vma = get_gate_vma(priv->task);
@@ -728,9 +728,9 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
if (!task)
goto out;
- ret = -EACCES;
mm = mm_for_maps(task);
- if (!mm)
+ ret = PTR_ERR(mm);
+ if (!mm || IS_ERR(mm))
goto out_task;
ret = -EINVAL;