summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/mixer.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/sound/pcm/mixer.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/sound/pcm/mixer.c')
-rw-r--r--sys/dev/sound/pcm/mixer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 5846847..9feccf6 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -494,8 +494,10 @@ mixer_clone(void *arg, char *name, int namelen, struct cdev **dev)
return;
if (strcmp(name, "mixer") == 0) {
sd = devclass_get_softc(pcm_devclass, snd_unit);
- if (sd != NULL)
+ if (sd != NULL) {
*dev = sd->mixer_dev;
+ dev_ref(*dev);
+ }
}
}
OpenPOWER on IntegriCloud