Use task_pid_nr() instead of pid_nr(task_pid())