Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2018 23:28:30 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342264 - head/sys/kern
Message-ID:  <201812192328.wBJNSUTP071324@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Wed Dec 19 23:28:29 2018
New Revision: 342264
URL: https://svnweb.freebsd.org/changeset/base/342264

Log:
  Check for probes enabled in priv_check_cred before evaluting the error.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/kern_priv.c

Modified: head/sys/kern/kern_priv.c
==============================================================================
--- head/sys/kern/kern_priv.c	Wed Dec 19 23:22:14 2018	(r342263)
+++ head/sys/kern/kern_priv.c	Wed Dec 19 23:28:29 2018	(r342264)
@@ -194,10 +194,12 @@ priv_check_cred(struct ucred *cred, int priv)
 	 */
 	error = EPERM;
 out:
-	if (error)
-		SDT_PROBE1(priv, kernel, priv_check, priv__err, priv);
-	else
-		SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv);
+	if (SDT_PROBES_ENABLED()) {
+		if (error)
+			SDT_PROBE1(priv, kernel, priv_check, priv__err, priv);
+		else
+			SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv);
+	}
 	return (error);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812192328.wBJNSUTP071324>