···150150 */151151 VFS_WARN_ON_ONCE(pid->stashed);152152153153+ /*154154+ * This if an error occurred during e.g., task creation that155155+ * causes us to never go through the exit path.156156+ */157157+ if (unlikely(!attr))158158+ return;159159+160160+ /* This never had a pidfd created. */153161 if (IS_ERR(attr))154162 return;155163156156- /*157157- * Any dentry must've been wiped from the pid by now. Otherwise158158- * there's a reference count bug.159159- */160160- VFS_WARN_ON_ONCE(pid->stashed);161161-162162- xattrs = attr->xattrs;164164+ xattrs = no_free_ptr(attr->xattrs);163165 if (xattrs)164164- simple_xattrs_free(attr->xattrs, NULL);166166+ simple_xattrs_free(xattrs, NULL);165167}166168167169#ifdef CONFIG_PROC_FS