Add additional cred_free_thread() calls that I had missed the first time.
Pointed out by: jhb
This commit is contained in:
parent
b416fa1041
commit
08b38412c8
@ -596,6 +596,9 @@ out:
|
|||||||
framep->tf_regs[FRAME_SP] = alpha_pal_rdusp();
|
framep->tf_regs[FRAME_SP] = alpha_pal_rdusp();
|
||||||
userret(td, framep, sticks);
|
userret(td, framep, sticks);
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -799,6 +802,9 @@ syscall(code, framep)
|
|||||||
*/
|
*/
|
||||||
STOPEVENT(p, S_SCX, code);
|
STOPEVENT(p, S_SCX, code);
|
||||||
|
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
#ifdef WITNESS
|
#ifdef WITNESS
|
||||||
if (witness_list(td)) {
|
if (witness_list(td)) {
|
||||||
panic("system call %s returning with mutex(s) held\n",
|
panic("system call %s returning with mutex(s) held\n",
|
||||||
|
@ -295,7 +295,7 @@ trap(frame)
|
|||||||
#ifdef DEV_NPX
|
#ifdef DEV_NPX
|
||||||
ucode = npxtrap();
|
ucode = npxtrap();
|
||||||
if (ucode == -1)
|
if (ucode == -1)
|
||||||
goto out;
|
goto userout;
|
||||||
#else
|
#else
|
||||||
ucode = code;
|
ucode = code;
|
||||||
#endif
|
#endif
|
||||||
@ -345,7 +345,7 @@ trap(frame)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
goto out;
|
goto userout;
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
goto user;
|
goto user;
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ trap(frame)
|
|||||||
lastalert = time_second;
|
lastalert = time_second;
|
||||||
}
|
}
|
||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
goto out;
|
goto userout;
|
||||||
#else /* !POWERFAIL_NMI */
|
#else /* !POWERFAIL_NMI */
|
||||||
/* machine/parity/power fail/"kitchen sink" faults */
|
/* machine/parity/power fail/"kitchen sink" faults */
|
||||||
/* XXX Giant */
|
/* XXX Giant */
|
||||||
@ -385,7 +385,7 @@ trap(frame)
|
|||||||
kdb_trap (type, 0, &frame);
|
kdb_trap (type, 0, &frame);
|
||||||
}
|
}
|
||||||
#endif /* DDB */
|
#endif /* DDB */
|
||||||
goto out;
|
goto userout;
|
||||||
} else if (panic_on_nmi)
|
} else if (panic_on_nmi)
|
||||||
panic("NMI indicates hardware failure");
|
panic("NMI indicates hardware failure");
|
||||||
break;
|
break;
|
||||||
@ -406,7 +406,7 @@ trap(frame)
|
|||||||
#ifdef DEV_NPX
|
#ifdef DEV_NPX
|
||||||
/* transparent fault (due to context switch "late") */
|
/* transparent fault (due to context switch "late") */
|
||||||
if (npxdna())
|
if (npxdna())
|
||||||
goto out;
|
goto userout;
|
||||||
#endif
|
#endif
|
||||||
if (!pmath_emulate) {
|
if (!pmath_emulate) {
|
||||||
i = SIGFPE;
|
i = SIGFPE;
|
||||||
@ -418,7 +418,7 @@ trap(frame)
|
|||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
if (!(frame.tf_eflags & PSL_T))
|
if (!(frame.tf_eflags & PSL_T))
|
||||||
goto out;
|
goto userout;
|
||||||
frame.tf_eflags &= ~PSL_T;
|
frame.tf_eflags &= ~PSL_T;
|
||||||
i = SIGTRAP;
|
i = SIGTRAP;
|
||||||
}
|
}
|
||||||
@ -662,6 +662,10 @@ trap(frame)
|
|||||||
user:
|
user:
|
||||||
userret(td, &frame, sticks);
|
userret(td, &frame, sticks);
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
|
userout:
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
out:
|
out:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1106,6 +1110,10 @@ syscall(frame)
|
|||||||
*/
|
*/
|
||||||
STOPEVENT(p, S_SCX, code);
|
STOPEVENT(p, S_SCX, code);
|
||||||
|
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WITNESS
|
#ifdef WITNESS
|
||||||
if (witness_list(td)) {
|
if (witness_list(td)) {
|
||||||
panic("system call %s returning with mutex(s) held\n",
|
panic("system call %s returning with mutex(s) held\n",
|
||||||
|
@ -295,7 +295,7 @@ trap(frame)
|
|||||||
#ifdef DEV_NPX
|
#ifdef DEV_NPX
|
||||||
ucode = npxtrap();
|
ucode = npxtrap();
|
||||||
if (ucode == -1)
|
if (ucode == -1)
|
||||||
goto out;
|
goto userout;
|
||||||
#else
|
#else
|
||||||
ucode = code;
|
ucode = code;
|
||||||
#endif
|
#endif
|
||||||
@ -345,7 +345,7 @@ trap(frame)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
goto out;
|
goto userout;
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
goto user;
|
goto user;
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ trap(frame)
|
|||||||
lastalert = time_second;
|
lastalert = time_second;
|
||||||
}
|
}
|
||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
goto out;
|
goto userout;
|
||||||
#else /* !POWERFAIL_NMI */
|
#else /* !POWERFAIL_NMI */
|
||||||
/* machine/parity/power fail/"kitchen sink" faults */
|
/* machine/parity/power fail/"kitchen sink" faults */
|
||||||
/* XXX Giant */
|
/* XXX Giant */
|
||||||
@ -385,7 +385,7 @@ trap(frame)
|
|||||||
kdb_trap (type, 0, &frame);
|
kdb_trap (type, 0, &frame);
|
||||||
}
|
}
|
||||||
#endif /* DDB */
|
#endif /* DDB */
|
||||||
goto out;
|
goto userout;
|
||||||
} else if (panic_on_nmi)
|
} else if (panic_on_nmi)
|
||||||
panic("NMI indicates hardware failure");
|
panic("NMI indicates hardware failure");
|
||||||
break;
|
break;
|
||||||
@ -406,7 +406,7 @@ trap(frame)
|
|||||||
#ifdef DEV_NPX
|
#ifdef DEV_NPX
|
||||||
/* transparent fault (due to context switch "late") */
|
/* transparent fault (due to context switch "late") */
|
||||||
if (npxdna())
|
if (npxdna())
|
||||||
goto out;
|
goto userout;
|
||||||
#endif
|
#endif
|
||||||
if (!pmath_emulate) {
|
if (!pmath_emulate) {
|
||||||
i = SIGFPE;
|
i = SIGFPE;
|
||||||
@ -418,7 +418,7 @@ trap(frame)
|
|||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
if (!(frame.tf_eflags & PSL_T))
|
if (!(frame.tf_eflags & PSL_T))
|
||||||
goto out;
|
goto userout;
|
||||||
frame.tf_eflags &= ~PSL_T;
|
frame.tf_eflags &= ~PSL_T;
|
||||||
i = SIGTRAP;
|
i = SIGTRAP;
|
||||||
}
|
}
|
||||||
@ -662,6 +662,10 @@ trap(frame)
|
|||||||
user:
|
user:
|
||||||
userret(td, &frame, sticks);
|
userret(td, &frame, sticks);
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
|
userout:
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
out:
|
out:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1106,6 +1110,10 @@ syscall(frame)
|
|||||||
*/
|
*/
|
||||||
STOPEVENT(p, S_SCX, code);
|
STOPEVENT(p, S_SCX, code);
|
||||||
|
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WITNESS
|
#ifdef WITNESS
|
||||||
if (witness_list(td)) {
|
if (witness_list(td)) {
|
||||||
panic("system call %s returning with mutex(s) held\n",
|
panic("system call %s returning with mutex(s) held\n",
|
||||||
|
@ -746,6 +746,9 @@ out:
|
|||||||
if (user) {
|
if (user) {
|
||||||
userret(td, framep, sticks);
|
userret(td, framep, sticks);
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -915,6 +918,9 @@ syscall(int code, u_int64_t *args, struct trapframe *framep)
|
|||||||
*/
|
*/
|
||||||
STOPEVENT(p, S_SCX, code);
|
STOPEVENT(p, S_SCX, code);
|
||||||
|
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
#ifdef WITNESS
|
#ifdef WITNESS
|
||||||
if (witness_list(td)) {
|
if (witness_list(td)) {
|
||||||
panic("system call %s returning with mutex(s) held\n",
|
panic("system call %s returning with mutex(s) held\n",
|
||||||
@ -1089,6 +1095,10 @@ ia32_syscall(struct trapframe *framep)
|
|||||||
*/
|
*/
|
||||||
STOPEVENT(p, S_SCX, code);
|
STOPEVENT(p, S_SCX, code);
|
||||||
|
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WITNESS
|
#ifdef WITNESS
|
||||||
if (witness_list(td)) {
|
if (witness_list(td)) {
|
||||||
panic("system call %s returning with mutex(s) held\n",
|
panic("system call %s returning with mutex(s) held\n",
|
||||||
|
@ -269,6 +269,9 @@ trap(struct trapframe *frame)
|
|||||||
|
|
||||||
userret(td, frame, sticks);
|
userret(td, frame, sticks);
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif /* DIAGNOSTIC */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -269,6 +269,9 @@ trap(struct trapframe *frame)
|
|||||||
|
|
||||||
userret(td, frame, sticks);
|
userret(td, frame, sticks);
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif /* DIAGNOSTIC */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -392,6 +392,9 @@ trapsig:
|
|||||||
user:
|
user:
|
||||||
userret(td, tf, sticks);
|
userret(td, tf, sticks);
|
||||||
mtx_assert(&Giant, MA_NOTOWNED);
|
mtx_assert(&Giant, MA_NOTOWNED);
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
out:
|
out:
|
||||||
CTR1(KTR_TRAP, "trap: td=%p return", td);
|
CTR1(KTR_TRAP, "trap: td=%p return", td);
|
||||||
return;
|
return;
|
||||||
@ -680,6 +683,9 @@ syscall(struct trapframe *tf)
|
|||||||
*/
|
*/
|
||||||
STOPEVENT(p, S_SCX, code);
|
STOPEVENT(p, S_SCX, code);
|
||||||
|
|
||||||
|
#ifdef DIAGNOSTIC
|
||||||
|
cred_free_thread(td);
|
||||||
|
#endif
|
||||||
#ifdef WITNESS
|
#ifdef WITNESS
|
||||||
if (witness_list(td)) {
|
if (witness_list(td)) {
|
||||||
panic("system call %s returning with mutex(s) held\n",
|
panic("system call %s returning with mutex(s) held\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user