svn commit: r284134 - stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace

Mark Johnston markj at FreeBSD.org
Sun Jun 7 20:10:12 UTC 2015


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


More information about the svn-src-stable mailing list