summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2016-03-08 00:46:03 +0000
committermarkj <markj@FreeBSD.org>2016-03-08 00:46:03 +0000
commitf407c155461e7fda8e800dc2b1756272fa4de003 (patch)
tree2e3c3947f39f0d6075760ad88f3ccba590db2c4d
parentb22a6e7b7cbc3af02b4a4bb6a5b49328d2fab47c (diff)
downloadFreeBSD-src-f407c155461e7fda8e800dc2b1756272fa4de003.zip
FreeBSD-src-f407c155461e7fda8e800dc2b1756272fa4de003.tar.gz
Fix a couple of silly mistakes in r291962.
- Handle the case where no DOF helper is provided. This occurs with the currently-unused DTRACEHIOC_ADD ioctl. - Fix some checks that prevented the loading DOF in the (non-default) lazyload mode.
-rw-r--r--sys/cddl/dev/dtrace/dtrace_ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/cddl/dev/dtrace/dtrace_ioctl.c b/sys/cddl/dev/dtrace/dtrace_ioctl.c
index 666c077..6e2b558 100644
--- a/sys/cddl/dev/dtrace/dtrace_ioctl.c
+++ b/sys/cddl/dev/dtrace/dtrace_ioctl.c
@@ -47,14 +47,14 @@ dtrace_ioctl_helper(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
/* FALLTHROUGH */
case DTRACEHIOC_ADD:
p = curproc;
- if (p->p_pid == dhp->dofhp_pid) {
+ if (dhp == NULL || p->p_pid == dhp->dofhp_pid) {
dof = dtrace_dof_copyin((uintptr_t)addr, &rval);
} else {
p = pfind(dhp->dofhp_pid);
if (p == NULL)
return (EINVAL);
if (!P_SHOULDSTOP(p) ||
- (p->p_flag & P_TRACED|P_WEXIT) == 0 ||
+ (p->p_flag & (P_TRACED | P_WEXIT)) != P_TRACED ||
p->p_pptr != curproc) {
PROC_UNLOCK(p);
return (EINVAL);
OpenPOWER on IntegriCloud