Merge tag '4.16-minor-rc-SMB3-fixes' of git://git.samba.org/sfrench/cifs-2.6
[sfrench/cifs-2.6.git] / arch / ia64 / kernel / perfmon.c
index c44f002e8f6bb9a936b59e59d5cffa56b68003ff..8586024940963bb9e1bf2be5d50d31e3fcc75755 100644 (file)
@@ -2610,17 +2610,10 @@ pfm_get_task(pfm_context_t *ctx, pid_t pid, struct task_struct **task)
        if (pid < 2) return -EPERM;
 
        if (pid != task_pid_vnr(current)) {
-
-               read_lock(&tasklist_lock);
-
-               p = find_task_by_vpid(pid);
-
                /* make sure task cannot go away while we operate on it */
-               if (p) get_task_struct(p);
-
-               read_unlock(&tasklist_lock);
-
-               if (p == NULL) return -ESRCH;
+               p = find_get_task_by_vpid(pid);
+               if (!p)
+                       return -ESRCH;
        }
 
        ret = pfm_task_incompatible(ctx, p);