diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 7929d73316d..f395f4a98e1 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -1995,10 +1995,9 @@ proc_set_cred_init(struct proc *p, struct ucred *newcred) * only used when the process is about to be freed, at which point it should * not be visible anymore). */ -struct ucred * +void proc_set_cred(struct proc *p, struct ucred *newcred) { - struct ucred *oldcred; MPASS(p->p_ucred != NULL); if (newcred == NULL) @@ -2006,11 +2005,9 @@ proc_set_cred(struct proc *p, struct ucred *newcred) else PROC_LOCK_ASSERT(p, MA_OWNED); - oldcred = p->p_ucred; p->p_ucred = newcred; if (newcred != NULL) PROC_UPDATE_COW(p); - return (oldcred); } struct ucred * diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index 9713623de6c..43849aac76b 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -112,7 +112,7 @@ struct ucred *crcopysafe(struct proc *p, struct ucred *cr); struct ucred *crdup(struct ucred *cr); void crextend(struct ucred *cr, int n); void proc_set_cred_init(struct proc *p, struct ucred *cr); -struct ucred *proc_set_cred(struct proc *p, struct ucred *cr); +void proc_set_cred(struct proc *p, struct ucred *cr); void crfree(struct ucred *cr); struct ucred *crget(void); struct ucred *crhold(struct ucred *cr);