Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177830249
D60509.1795381587.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
741 B
Referenced Files
None
Subscribers
None
D60509.1795381587.diff
View Options
diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -265,17 +265,25 @@
int mode = 0;
d = oidp->oid_arg1;
- if (!PCM_REGISTERED(d))
+ bus_topo_lock();
+ if (!PCM_REGISTERED(d)) {
+ bus_topo_unlock();
return (ENODEV);
+ }
+ /*
+ * Do not give up the topology lock until the device is busied, or it
+ * might detach between unlocking and busying.
+ */
+ PCM_ACQUIRE(d);
+ bus_topo_unlock();
- PCM_LOCK(d);
if (d->playcount > 0)
mode |= PCM_MODE_PLAY;
if (d->reccount > 0)
mode |= PCM_MODE_REC;
if (d->mixer != NULL)
mode |= PCM_MODE_MIXER;
- PCM_UNLOCK(d);
+ PCM_RELEASE(d);
return (sysctl_handle_int(oidp, &mode, 0, req));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 9:06 PM (4 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41512080
Default Alt Text
D60509.1795381587.diff (741 B)
Attached To
Mode
D60509: sound: Busy the device in sysctl_dev_pcm_mode()
Attached
Detach File
Event Timeline