summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornetchild <netchild@FreeBSD.org>2006-10-08 17:10:34 +0000
committernetchild <netchild@FreeBSD.org>2006-10-08 17:10:34 +0000
commitae7b29d2e1bb23beefdd8c22b97a79e29b86b013 (patch)
treecb5626630596daf7c5a34248791e0b7dace70d07 /sys
parent4e02401696800412c7ef181b4030bf6710d739ac (diff)
downloadFreeBSD-src-ae7b29d2e1bb23beefdd8c22b97a79e29b86b013.zip
FreeBSD-src-ae7b29d2e1bb23beefdd8c22b97a79e29b86b013.tar.gz
- change if (cond) panic() to KASSERT.
- Dont forget to free em in a case of error. Suggested by: ssouhlal Submitted by: rdivacky Tested with: LTP
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/linux/linux_emul.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c
index c1dafbc..2f92ebd 100644
--- a/sys/compat/linux/linux_emul.c
+++ b/sys/compat/linux/linux_emul.c
@@ -97,8 +97,7 @@ linux_proc_init(struct thread *td, pid_t child, int flags)
LIST_INIT(&s->threads);
}
p = pfind(child);
- if (p == NULL)
- panic("process not found in proc_init\n");
+ KASSERT(p != NULL, ("process not found in proc_init\n"));
p->p_emuldata = em;
PROC_UNLOCK(p);
EMUL_LOCK(&emul_lock);
@@ -182,8 +181,10 @@ linux_proc_exit(void *arg __unused, struct proc *p)
int null = 0;
error = copyout(&null, child_clear_tid, sizeof(null));
- if (error)
+ if (error) {
+ free(em, M_LINUX);
return;
+ }
/* futexes stuff */
cup.uaddr = child_clear_tid;
OpenPOWER on IntegriCloud