Page MenuHomeFreeBSD

D61224.1793999997.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61224.1793999997.diff

diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c
--- a/sys/dev/sound/pcm/feeder_eq.c
+++ b/sys/dev/sound/pcm/feeder_eq.c
@@ -442,10 +442,18 @@
int err, val, oval;
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();
+
if (d->flags & SD_F_EQ)
val = 1;
else
@@ -480,10 +488,18 @@
char buf[32];
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();
+
val = d->eqpreamp;
bzero(buf, sizeof(buf));
(void)snprintf(buf, sizeof(buf), "%c%d.%ddB",
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
@@ -234,10 +234,18 @@
int err, val;
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();
+
val = (d->flags & SD_F_BITPERFECT) ? 1 : 0;
err = sysctl_handle_int(oidp, &val, 0, req);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 6, 9:19 PM (9 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41512026
Default Alt Text
D61224.1793999997.diff (1 KB)

Event Timeline