Author: markj
Date: Sun Jun  7 20:10:11 2015
New Revision: 284134
URL: https://svnweb.freebsd.org/changeset/base/284134

Log:
  MFC r278136, r278137, r278370:
  Diff reduction with illumos, in preparation for merging r266993 from the
  vendor branch. No functional change.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Sun Jun 
 7 19:59:01 2015        (r284133)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c   Sun Jun 
 7 20:10:11 2015        (r284134)
@@ -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
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to