summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormini <mini@FreeBSD.org>2002-07-13 04:36:50 +0000
committermini <mini@FreeBSD.org>2002-07-13 04:36:50 +0000
commita02f691cf327e818bceba1863bc2a55251aa737f (patch)
tree6c52f43001bde6767e8144b44c0ec175c0a053c6 /sys
parent41fc8114c091411a45564a858af8e7b3cc3af5b7 (diff)
downloadFreeBSD-src-a02f691cf327e818bceba1863bc2a55251aa737f.zip
FreeBSD-src-a02f691cf327e818bceba1863bc2a55251aa737f.tar.gz
Add additional cred_free_thread() calls that I had missed the first time.
Pointed out by: jhb
Diffstat (limited to 'sys')
-rw-r--r--sys/alpha/alpha/trap.c6
-rw-r--r--sys/amd64/amd64/trap.c20
-rw-r--r--sys/i386/i386/trap.c20
-rw-r--r--sys/ia64/ia64/trap.c10
-rw-r--r--sys/powerpc/aim/trap.c3
-rw-r--r--sys/powerpc/powerpc/trap.c3
-rw-r--r--sys/sparc64/sparc64/trap.c6
7 files changed, 56 insertions, 12 deletions
diff --git a/sys/alpha/alpha/trap.c b/sys/alpha/alpha/trap.c
index f4af4ba..2114c67 100644
--- a/sys/alpha/alpha/trap.c
+++ b/sys/alpha/alpha/trap.c
@@ -596,6 +596,9 @@ out:
framep->tf_regs[FRAME_SP] = alpha_pal_rdusp();
userret(td, framep, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
}
return;
@@ -799,6 +802,9 @@ syscall(code, framep)
*/
STOPEVENT(p, S_SCX, code);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
#ifdef WITNESS
if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n",
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index fddb517..474b16d 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -295,7 +295,7 @@ trap(frame)
#ifdef DEV_NPX
ucode = npxtrap();
if (ucode == -1)
- goto out;
+ goto userout;
#else
ucode = code;
#endif
@@ -345,7 +345,7 @@ trap(frame)
}
#endif
if (i == -1)
- goto out;
+ goto userout;
if (i == 0)
goto user;
@@ -370,7 +370,7 @@ trap(frame)
lastalert = time_second;
}
mtx_unlock(&Giant);
- goto out;
+ goto userout;
#else /* !POWERFAIL_NMI */
/* machine/parity/power fail/"kitchen sink" faults */
/* XXX Giant */
@@ -385,7 +385,7 @@ trap(frame)
kdb_trap (type, 0, &frame);
}
#endif /* DDB */
- goto out;
+ goto userout;
} else if (panic_on_nmi)
panic("NMI indicates hardware failure");
break;
@@ -406,7 +406,7 @@ trap(frame)
#ifdef DEV_NPX
/* transparent fault (due to context switch "late") */
if (npxdna())
- goto out;
+ goto userout;
#endif
if (!pmath_emulate) {
i = SIGFPE;
@@ -418,7 +418,7 @@ trap(frame)
mtx_unlock(&Giant);
if (i == 0) {
if (!(frame.tf_eflags & PSL_T))
- goto out;
+ goto userout;
frame.tf_eflags &= ~PSL_T;
i = SIGTRAP;
}
@@ -662,6 +662,10 @@ trap(frame)
user:
userret(td, &frame, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+userout:
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
out:
return;
}
@@ -1106,6 +1110,10 @@ syscall(frame)
*/
STOPEVENT(p, S_SCX, code);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
+
#ifdef WITNESS
if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n",
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index fddb517..474b16d 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -295,7 +295,7 @@ trap(frame)
#ifdef DEV_NPX
ucode = npxtrap();
if (ucode == -1)
- goto out;
+ goto userout;
#else
ucode = code;
#endif
@@ -345,7 +345,7 @@ trap(frame)
}
#endif
if (i == -1)
- goto out;
+ goto userout;
if (i == 0)
goto user;
@@ -370,7 +370,7 @@ trap(frame)
lastalert = time_second;
}
mtx_unlock(&Giant);
- goto out;
+ goto userout;
#else /* !POWERFAIL_NMI */
/* machine/parity/power fail/"kitchen sink" faults */
/* XXX Giant */
@@ -385,7 +385,7 @@ trap(frame)
kdb_trap (type, 0, &frame);
}
#endif /* DDB */
- goto out;
+ goto userout;
} else if (panic_on_nmi)
panic("NMI indicates hardware failure");
break;
@@ -406,7 +406,7 @@ trap(frame)
#ifdef DEV_NPX
/* transparent fault (due to context switch "late") */
if (npxdna())
- goto out;
+ goto userout;
#endif
if (!pmath_emulate) {
i = SIGFPE;
@@ -418,7 +418,7 @@ trap(frame)
mtx_unlock(&Giant);
if (i == 0) {
if (!(frame.tf_eflags & PSL_T))
- goto out;
+ goto userout;
frame.tf_eflags &= ~PSL_T;
i = SIGTRAP;
}
@@ -662,6 +662,10 @@ trap(frame)
user:
userret(td, &frame, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+userout:
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
out:
return;
}
@@ -1106,6 +1110,10 @@ syscall(frame)
*/
STOPEVENT(p, S_SCX, code);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
+
#ifdef WITNESS
if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n",
diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c
index 74dfebf..254aec6 100644
--- a/sys/ia64/ia64/trap.c
+++ b/sys/ia64/ia64/trap.c
@@ -746,6 +746,9 @@ out:
if (user) {
userret(td, framep, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
}
return;
@@ -915,6 +918,9 @@ syscall(int code, u_int64_t *args, struct trapframe *framep)
*/
STOPEVENT(p, S_SCX, code);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
#ifdef WITNESS
if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n",
@@ -1089,6 +1095,10 @@ ia32_syscall(struct trapframe *framep)
*/
STOPEVENT(p, S_SCX, code);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
+
#ifdef WITNESS
if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n",
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c
index 067eb3a..e43e9cc 100644
--- a/sys/powerpc/aim/trap.c
+++ b/sys/powerpc/aim/trap.c
@@ -269,6 +269,9 @@ trap(struct trapframe *frame)
userret(td, frame, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif /* DIAGNOSTIC */
}
static void
diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c
index 067eb3a..e43e9cc 100644
--- a/sys/powerpc/powerpc/trap.c
+++ b/sys/powerpc/powerpc/trap.c
@@ -269,6 +269,9 @@ trap(struct trapframe *frame)
userret(td, frame, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif /* DIAGNOSTIC */
}
static void
diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c
index 66fb141..0ab35af 100644
--- a/sys/sparc64/sparc64/trap.c
+++ b/sys/sparc64/sparc64/trap.c
@@ -392,6 +392,9 @@ trapsig:
user:
userret(td, tf, sticks);
mtx_assert(&Giant, MA_NOTOWNED);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
out:
CTR1(KTR_TRAP, "trap: td=%p return", td);
return;
@@ -680,6 +683,9 @@ syscall(struct trapframe *tf)
*/
STOPEVENT(p, S_SCX, code);
+#ifdef DIAGNOSTIC
+ cred_free_thread(td);
+#endif
#ifdef WITNESS
if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n",
OpenPOWER on IntegriCloud