summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire/fwdev.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-03-31 12:19:44 +0000
committerphk <phk@FreeBSD.org>2005-03-31 12:19:44 +0000
commit7af1e31761f34e698cdf576e46c042b327f5a612 (patch)
tree3f79498c2fd283a3ff468ae4f9116e9f395f4fa7 /sys/dev/firewire/fwdev.c
parentbf21be6c028410767b09b4755acb72b254e317d8 (diff)
downloadFreeBSD-src-7af1e31761f34e698cdf576e46c042b327f5a612.zip
FreeBSD-src-7af1e31761f34e698cdf576e46c042b327f5a612.tar.gz
Explicitly hold a reference to the cdev we have just cloned. This
closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
Diffstat (limited to 'sys/dev/firewire/fwdev.c')
-rw-r--r--sys/dev/firewire/fwdev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c
index 79c74af..ecd56c4 100644
--- a/sys/dev/firewire/fwdev.c
+++ b/sys/dev/firewire/fwdev.c
@@ -875,6 +875,7 @@ found:
*dev = make_dev(&firewire_cdevsw, MAKEMINOR(devflag[i], unit, sub),
UID_ROOT, GID_OPERATOR, 0660,
"%s%d.%d", devnames[i], unit, sub);
+ dev_ref(*dev);
(*dev)->si_flags |= SI_CHEAPCLONE;
dev_depends(sc->dev, *dev);
return;
OpenPOWER on IntegriCloud