diff options
author | markj <markj@FreeBSD.org> | 2015-06-07 20:10:11 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2015-06-07 20:10:11 +0000 |
commit | 0e7047f3cf7f81f1069743c80b4fc496de1b3620 (patch) | |
tree | 56d4a4dff3c4388555e965bf4bfb1e4960a66ba4 /sys/cddl | |
parent | 96bd137d4060668a3154cf94316b8a0a5f1721d8 (diff) | |
download | FreeBSD-src-0e7047f3cf7f81f1069743c80b4fc496de1b3620.zip FreeBSD-src-0e7047f3cf7f81f1069743c80b4fc496de1b3620.tar.gz |
MFC r278136, r278137, r278370:
Diff reduction with illumos, in preparation for merging r266993 from the
vendor branch. No functional change.
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 4c171c6..cd7c6c4 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -14178,7 +14178,7 @@ dtrace_state_create(struct cdev *dev) if (dev != NULL) { cr = dev->si_cred; m = dev2unit(dev); - } + } /* Allocate memory for the state. */ state = kmem_zalloc(sizeof(dtrace_state_t), KM_SLEEP); @@ -16845,23 +16845,29 @@ dtrace_dtr(void *data) mutex_enter(&cpu_lock); mutex_enter(&dtrace_lock); - if (state != NULL) { - if (state->dts_anon) { - /* - * There is anonymous state. Destroy that first. - */ - ASSERT(dtrace_anon.dta_state == NULL); - dtrace_state_destroy(state->dts_anon); - } +#ifdef illumos + if (state->dts_anon) +#else + if (state != NULL && state->dts_anon) +#endif + { + /* + * There is anonymous state. Destroy that first. + */ + ASSERT(dtrace_anon.dta_state == NULL); + dtrace_state_destroy(state->dts_anon); + } +#ifdef illumos + dtrace_state_destroy(state); +#else + if (state != NULL) { dtrace_state_destroy(state); - -#if !defined(sun) kmem_free(state, 0); -#endif } - +#endif ASSERT(dtrace_opens > 0); + #if defined(sun) /* * Only relinquish control of the kernel debugger interface when there |