summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/brand/lx/os/lx_brand.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr/src/uts/common/brand/lx/os/lx_brand.c b/usr/src/uts/common/brand/lx/os/lx_brand.c
index 142123df00..1ddc0367c8 100644
--- a/usr/src/uts/common/brand/lx/os/lx_brand.c
+++ b/usr/src/uts/common/brand/lx/os/lx_brand.c
@@ -160,7 +160,13 @@ lx_proc_exit(proc_t *p, klwp_t *lwp)
zone_status_get(global_zone) < ZONE_IS_SHUTTING_DOWN)
(void) zone_kadmin(A_REBOOT, 0, NULL, CRED());
}
- lx_exitlwp(lwp);
+
+ /*
+ * We might get here if fork failed (e.g. ENOMEM) so we don't always
+ * have an lwp (see brand_clearbrand).
+ */
+ if (lwp != NULL)
+ lx_exitlwp(lwp);
kmem_free(p->p_brand_data, sizeof (struct lx_proc_data));
p->p_brand_data = NULL;
}