Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
{
struct mm_struct *mm = mm_access(task, PTRACE_MODE_READ);
int res = PTR_ERR(mm);
- if (mm && !IS_ERR(mm)) {
+ if (!IS_ERR_OR_NULL(mm)) {
unsigned int nwords = 0;
do {
nwords += 2;
return ERR_PTR(-ESRCH);
mm = mm_access(priv->task, PTRACE_MODE_READ);
- if (!mm || IS_ERR(mm))
+ if (IS_ERR_OR_NULL(mm))
return mm;
down_read(&mm->mmap_sem);
mm = mm_access(task, PTRACE_MODE_READ);
ret = PTR_ERR(mm);
- if (!mm || IS_ERR(mm))
+ if (IS_ERR_OR_NULL(mm))
goto out_free;
pagemap_walk.pmd_entry = pagemap_pte_range;
return ERR_PTR(-ESRCH);
mm = mm_access(priv->task, PTRACE_MODE_READ);
- if (!mm || IS_ERR(mm)) {
+ if (IS_ERR_OR_NULL(mm)) {
put_task_struct(priv->task);
priv->task = NULL;
return mm;