fs/proc/task_mmu.c: shift "priv->task = NULL" from m_start() to m_stop()
authorOleg Nesterov <oleg@redhat.com>
Thu, 9 Oct 2014 22:25:32 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Oct 2014 02:25:49 +0000 (22:25 -0400)
commit0d5f5f45f9a4f1f6b694c37f5142ebea893f0a15
tree6b9a19ef25763611d857d19f129ca74c186b46c5
parent23d54837e4f3a44ad4514d5eae8245c2250217ff
fs/proc/task_mmu.c: shift "priv->task = NULL" from m_start() to m_stop()

1. There is no reason to reset ->tail_vma in m_start(), if we return
   IS_ERR_OR_NULL() it won't be used.

2. m_start() also clears priv->task to ensure that m_stop() won't use
   the stale pointer if we fail before get_task_struct(). But this is
   ugly and confusing, move this initialization in m_stop().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/task_mmu.c