--- x/fs/pidfs.c +++ y/fs/pidfs.c @@ -150,7 +150,7 @@ void pidfs_free_pid(struct pid *pid) */ VFS_WARN_ON_ONCE(pid->stashed); - if (IS_ERR(attr)) + if (IS_ERR(attr) || !attr) return; /*