report errors in /proc/*/*map* sanely

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2011-02-15 22:22:54 -05:00
parent ca6b0bf0e0
commit ec6fd8a435
3 changed files with 13 additions and 11 deletions

View File

@@ -199,13 +199,13 @@ static void *m_start(struct seq_file *m, loff_t *pos)
/* pin the task and mm whilst we play with them */
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) {
if (!mm || IS_ERR(mm)) {
put_task_struct(priv->task);
priv->task = NULL;
return NULL;
return mm;
}
down_read(&mm->mmap_sem);