aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2018-12-19 23:28:29 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2018-12-19 23:28:29 +0000
commit3e0178fb9472f29dc35f1fb52517155d794466c2 (patch)
treeacfb74f1d9493e2c1147dfb693cf87ad8d7b93fc
parentc3efee6ed9956c8fb76bdb2adf04d080068ed44c (diff)
downloadsrc-3e0178fb9472f29dc35f1fb52517155d794466c2.tar.gz
src-3e0178fb9472f29dc35f1fb52517155d794466c2.zip
Check for probes enabled in priv_check_cred before evaluting the error.
Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=342264
-rw-r--r--sys/kern/kern_priv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_priv.c b/sys/kern/kern_priv.c
index 1a77801dad47..98271195d9fd 100644
--- a/sys/kern/kern_priv.c
+++ b/sys/kern/kern_priv.c
@@ -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);
}